Repository navigation
Let caller-offered computer tools pass through the headless middleware - #805
Open
charan-rathore wants to merge 1 commit into
Open
charan-rathore wants to merge 1 commit into
charan-rathore wants to merge 1 commit into
Conversation
HeadlessToolsMiddleware claimed every computer_* tool call by name prefix but only holds the Bot's server-side grants, so in a chat with a remote AG-UI Bot the browser-offered computer_* calls were intercepted and refused as "unavailable for this headless turn" instead of reaching the browser. Claim computer_* calls only when the caller did not offer the tool; the governed refusal still covers genuinely browserless turns. Fixes CopilotKit#804 Signed-off-by: Charan Rathore <180254320+charan-rathore@users.noreply.github.com>
charan-rathore
requested review from
MikeRyanDev,
davidmckayv,
guidovizoso,
mxmzb and
tylerslaton
as code owners
October 18, 2026 09:03
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Fixes #804. In a chat with a remote AG-UI Bot, every
computer_*call was refused with "The tool computer_navigate is unavailable for this headless turn." while the built-in General Assistant browsed fine on the same deployment.HeadlessToolsMiddlewareclaims everycomputer_*tool call by name prefix, but its tool map only holds the Bot's server-side grants. A remote Bot has no server-side computer grant, so a call to the browser-offeredcomputer_*tools was intercepted and refused instead of passing through to the caller that offered them. The middleware's own continuation logic already anticipates partially-owned pending sets (owned.length !== pending.length), so the fix is one condition: claim acomputer_*call only when the caller did not offer the tool. The governed refusal still covers genuinely browserless turns (routines), where the call would otherwise die silently.Where it runs
Setof tool names already in the input.Boundary and audit
Changelog
CHANGELOG.mdunderUnreleased.Proof
New
toolkit/tests/headless-tools.test.ts(bun test):a computer tool the caller offers passes through for the caller to execute- RED before the fix (the call was refused and the run continued with a fabricated error result), GREEN after: the terminal event is forwarded unanswered and no error result is synthesized.a computer tool the caller did not offer still gets the governed refusal- the Remote AG-UI Bots can't use the browser in chat:computer_*calls refused as "unavailable for this headless turn" #804-adjacent guarantee: browserless turns still get the refusal.Existing
server/tests/headless-tools.test.ts: all 8 tests pass unchanged, including "unknown computer tool calls become error results rather than commands".