Skip to content

feat(provider-codex): support MCP elicitation requests (fixes Computer Use perms, etc) - #3113

Closed
smsunarto wants to merge 6 commits into
get-bb:mainfrom
smsunarto:scott/codex-computer-use-approval
Closed

smsunarto wants to merge 6 commits into
get-bb:mainfrom
smsunarto:scott/codex-computer-use-approval

Conversation

@smsunarto

@smsunarto smsunarto commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Human comments

What was wrong

BB did not handle Codex's mcpServer/elicitation/request, so app-access requests were silently declined and other MCP elicitations could not collect answers.

What changed

  • Computer Use: native app icons, session/persistent approval, and Decline. High-risk warnings remain visible. Codex owns permission storage.
  • Forms: typed text, numbers, booleans, and choices with defaults and validation. Unsupported schemas cannot be accepted.
  • URLs: show the destination and open only on user action. Acceptance means the URL opened, not that sign-in completed.
  • Shared BB styling: compact composer cards, visible actions, and a subtle scroll fade. CLI/SDK responses and the provider guide cover all request kinds.
  • Contracts: experimental plugin-owned headings, SDK 0.4.48, and host daemon protocol 183.

How you verified

  • Decoder regressions failed before the fix. Provider, contract, renderer, SDK, and guide tests/typechecks pass.
  • Live BB: real Calculator request and decline, typed form submission, required-field errors, scrolling, and URL actions. Live grant persistence remains unverified.
  • CI: 12 checks passed, 2 skipped.

Screenshots

Computer Use

Computer Use

Structured form

Structured form

Validation

Form validation

URL request

URL request

AGENT GENERATED

@smsunarto smsunarto changed the title feat(provider-codex): support MCP elicitation requests feat(provider-codex): support MCP elicitation requests (fixes Computer Use perms, etc) Sep 5, 2026
@SawyerHood

Copy link
Copy Markdown
Collaborator

This is an automated message. We have closed this pull request because it has been open for more than two weeks.

@smsunarto

Copy link
Copy Markdown
Contributor Author

Superseded by #5664 (rebased onto current main).

SawyerHood added a commit that referenced this pull request Oct 19, 2026
…r Use perms, etc) (#5664)

## 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

- **Computer Use:** the card shows the app's native icon with a Computer
Use badge, its name, and its bundle ID. It offers session or persistent
approval, and Decline. Codex owns permission storage. The title reads
"Allow Codex to use <App>?".
- **Risk:** high-risk warnings appear first, in a destructive callout.
- **Forms:** typed text, numbers, booleans, and choices with defaults
and validation, checked in the UI and again at the bridge boundary.
Actions stay pinned while fields scroll. Unsupported schemas offer only
Decline.
- **URLs:** show the destination and open only on user action.
Acceptance means the URL opened, not that sign-in completed.
- **Long prompts:** titles are capped at the 160-character interaction
limit; the card shows the full message when the title truncates it.
- **Provider-origin cards:** the core composer no longer adds "Asked by
the agent through <provider>" above cards from the thread's own provider
(Codex, Pi). Plugin-origin cards keep "Requested by <plugin>".
- **Docs and stories:** CLI/SDK responses for every request kind are in
the `codex-provider` skill. A Ladle story covers each card state.

Changes from #3113 required by current main:

- The `experimental_hideHeader` SDK API is dropped, along with the SDK
version bump and the audit entry. Main's pending-interaction shell owns
the title.
- No host-daemon protocol bump: no server/daemon wire fields change.
- Response encoding shares `providerInteractionOutcomeSchema` with
main's Codex `user_question` path.
- Tests use only public SDK imports, keeping the plugin forkable.

## Previews

Live Computer Use request from Codex:

<img
src="https://raw.githubusercontent.com/smsunarto/bb/5e6e2996a7c45b4b5abd45f602eed4a8214d0eb1/computer-use-live.png"
width="728" alt="Computer Use request for Calculator">

High-risk app access:

<img
src="https://raw.githubusercontent.com/smsunarto/bb/5e6e2996a7c45b4b5abd45f602eed4a8214d0eb1/computer-use-high-risk.png"
width="736" alt="High-risk Computer Use request with warning callout">

Form, with actions pinned while fields scroll:

<img
src="https://raw.githubusercontent.com/smsunarto/bb/5e6e2996a7c45b4b5abd45f602eed4a8214d0eb1/form.png"
width="736" alt="MCP form with team choice and text fields">

URL request:

<img
src="https://raw.githubusercontent.com/smsunarto/bb/5e6e2996a7c45b4b5abd45f602eed4a8214d0eb1/url.png"
width="736" alt="MCP URL request for GitHub sign-in">

Unsupported schema:

<img
src="https://raw.githubusercontent.com/smsunarto/bb/5e6e2996a7c45b4b5abd45f602eed4a8214d0eb1/unsupported.png"
width="736" alt="Unsupported MCP request with Decline only">

## How you verified

- `pnpm exec turbo run typecheck test lint
--filter=bb-plugin-provider-codex`: 496 tests pass. `@bb/app` typecheck
and lint pass; composer and banner tests pass. `@bb/agent-runtime` tests
pass.
- The long-prompt regression fails when the title cap is removed.
- Live dev instance: a real Codex Computer Use request rendered the card
with Calculator's native icon. Decline resolved as
`{"action":"decline"}`, and Codex reported that access was not approved.
- The form, URL, high-risk, and unsupported previews come from the Ladle
story; no live MCP server sent those kinds.

Fixes #4645

> AGENT GENERATED


## Maintainer follow-up (rebased on main)

- **Computer Use card is no longer spoofable**: it now requires the
`cua_repl` server plus `connector_id: "computer-use"`. The same `_meta`
from any other server renders as a plain tool approval. Every card names
the requesting MCP server.
- **MCP tool-call approvals** (`codex_approval_kind: "mcp_tool_call"`)
get a `tool_approval` card showing server, tool, description and
(size-capped) arguments, with Allow / Decline, plus session/always
scopes only when `_meta.persist` offers them.
- **Core attribution restored**: the "Asked by the agent through …"
byline change in `PluginPendingInteractionComposer.tsx` is reverted.
- **Stop turn / disconnect** now answers Codex with `{action:"cancel"}`
instead of a JSON-RPC error (Codex was turning that into a decline).
- Titles reuse `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.
- Verified end to end against codex-cli 0.163.0 with a throwaway MCP
server: form, URL, tool approval (once/session/decline), spoofed
Computer Use, and stop-turn cancel.

---------

Co-authored-by: sms-yui <[email protected]>
Co-authored-by: Sawyer Hood <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants