Repository navigation
feat(provider-codex): support MCP elicitation requests (fixes Computer Use perms, etc) - #5664
Merged
Merged
Conversation
sms-yui
force-pushed
the
scott/mcp-elicitation
branch
from
October 17, 2026 01:14
75fe86f to
433d05e
Compare
|
+1 |
Codex's mcpServer/elicitation/request was rejected, so Computer Use app
access was silently declined and other MCP forms could not collect answers.
- Computer Use: native app icon, session/always scopes, Decline, and
visible high-risk warnings. Codex owns grant persistence.
- Forms: typed text, numbers, booleans, and choices with defaults and
validation in the UI and again at the bridge boundary.
- URLs: show the destination and open only on user action.
Rebased onto main's pending-interaction shell: the shell's title carries
the request ("Allow Codex to use <App>?" for app access), so the
experimental_hideHeader SDK API is dropped. Docs live in the
codex-provider skill. No wire changes, so no host-daemon protocol bump.
- One source row: app icon with a Computer Use badge and its bundle ID, or the MCP server name, replacing three stacked attribution lines. - High-risk warnings render as a destructive callout. - Form actions stay pinned while fields scroll in the pending-interaction shell, instead of a nested scroll that hid Submit below the fold. - Boolean fields lay out inline; the URL preview drops its misleading link arrow. - App icons are fetched at 64px so they stay sharp on 2x displays. - Ladle story covers every elicitation state.
"Asked by the agent through <provider>" repeated what the thread and the card already say. Plugin-origin cards keep "Requested by <plugin>", since that is the only sign of which plugin is asking.
…ction cards" Restores the "Asked by the agent through <provider>" line on every provider-origin plugin card. It is the only sign in core of which provider plugin is relaying a request; the Codex MCP elicitation card now names the requesting MCP server itself, so the two lines answer different questions. This reverts commit b549ecff3c.
Computer Use identity: the Computer Use card was chosen from
`_meta.connector_id`/`connector_name` alone, which any MCP server can set:
Codex forwards a server's elicitation `_meta` verbatim (verified against
codex-cli 0.163.0). The card now requires Codex's own Computer Use server
(`cua_repl`, which Codex names itself) plus the `computer-use` connector;
the same metadata from any other server shows as a plain tool approval.
The Computer Use card also names the requesting server.
MCP tool-call approvals: Codex asks before running an MCP tool with a
fieldless form tagged `codex_approval_kind: "mcp_tool_call"`. These now
decode to a `tool_approval` card that shows the server, tool, description
and arguments (`tool_params_display`, falling back to `tool_params`, bounded
in count and length), with Allow / Decline plus "Allow for this session" and
"Always allow" when `_meta.persist` offers them. Answers encode as
`{action:"accept", content:{}, _meta:{persist}|null}`, which Codex honours
(a session grant stops the next prompt). A generic fieldless form now says
"Accept" instead of "Submit response".
Stop turn / disconnect: the runtime answers an interrupted interaction
with a JSON-RPC error, which the bridge forwarded to Codex as an error.
For MCP elicitations the bridge now answers `{action:"cancel"}` when the
runtime request fails or resolves with anything but a request answer;
invalid answers still fail closed with an error.
Titles: truncate with the shared PLUGIN_INTERACTION_MAX_TITLE_LENGTH, now
re-exported from @get-bb/plugin-sdk/provider-bridge (SDK 0.6.56; the plugin
requires >=0.6.56), without splitting surrogate pairs.
The earlier tsconfig change that dropped the @get-bb/plugin-sdk path
mappings stays: the package's `types` exports already point at the same
bundled declarations, and with `resolve.tsconfigPaths` (needed for the
`@/components/ui/*` aliases in the view tests) Vitest would otherwise
resolve runtime SDK imports to .d.ts files. Other plugins with tsx tests
use the same setup.
Fixtures for the tool approval and the spoofed Computer Use request were
captured from codex-cli 0.163.0 app-server.
…d bound tool args The title helper imported PLUGIN_INTERACTION_MAX_TITLE_LENGTH from @get-bb/plugin-sdk/provider-bridge inside mcp-elicitation.ts, which app.tsx also imports. That pulled Node-only modules (cross-spawn, fs) into the frontend bundle and the server's rebuild failed, leaving every Codex elicitation as "The plugin form is unavailable". The title helper now lives in host-only mcp-elicitation-title.ts. Tool approval arguments are also held to a 32 KiB byte budget (on top of the 50-argument and 2000-character caps) so a request with large arguments stays under the 64 KiB interaction payload limit instead of being rejected.
SawyerHood
force-pushed
the
scott/mcp-elicitation
branch
from
October 19, 2026 20:20
895e7c0 to
a976332
Compare
3 tasks done
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.
Human comments
What was wrong
BB did not handle Codex's
mcpServer/elicitation/request, so Computer Use app-access requests were silently declined and other MCP elicitations could not collect answers. Revives #3113, which was auto-closed as stale, rebased onto current main.What changed
codex-providerskill. A Ladle story covers each card state.Changes from #3113 required by current main:
experimental_hideHeaderSDK API is dropped, along with the SDK version bump and the audit entry. Main's pending-interaction shell owns the title.providerInteractionOutcomeSchemawith main's Codexuser_questionpath.Previews
Live Computer Use request from Codex:
High-risk app access:
Form, with actions pinned while fields scroll:
URL request:
Unsupported schema:
How you verified
pnpm exec turbo run typecheck test lint --filter=bb-plugin-provider-codex: 496 tests pass.@bb/apptypecheck and lint pass; composer and banner tests pass.@bb/agent-runtimetests pass.{"action":"decline"}, and Codex reported that access was not approved.Fixes #4645
Maintainer follow-up (rebased on main)
cua_replserver plusconnector_id: "computer-use". The same_metafrom any other server renders as a plain tool approval. Every card names the requesting MCP server.codex_approval_kind: "mcp_tool_call") get atool_approvalcard showing server, tool, description and (size-capped) arguments, with Allow / Decline, plus session/always scopes only when_meta.persistoffers them.PluginPendingInteractionComposer.tsxis reverted.{action:"cancel"}instead of a JSON-RPC error (Codex was turning that into a decline).PLUGIN_INTERACTION_MAX_TITLE_LENGTH(re-exported from@get-bb/plugin-sdk/provider-bridge) and truncate without splitting surrogate pairs; fixed the card bundle's browser build. Plugin SDK → 0.6.57.