Repository navigation
Conversation
morajabi
force-pushed
the
claude/codex-mcp-approvals-734f0b
branch
from
November 23, 2026 14:23
2078c3c to
2fc5274
Compare
…prompt is left unanswerable Codex asks to run an MCP tool with a message-only form elicitation (empty requestedSchema, _meta.codex_approval_kind "mcp_tool_call"). Main mapped it to a question with no fields: the chat showed only the message and Codex waited until the turn was stopped. - map message-only elicitations to approvals: a tool approval is a tool card (server · tool, arguments bounded and stripped of control and bidi-override characters) with the Codex TUI's choices (Allow, the remember options _meta.persist allows, Cancel with the user cancellation reason); other message-only requests get Allow/Deny/Cancel - an elicitation with no turnId belongs to its thread's running turn, so its card closes when that turn ends or is interrupted - a sub-agent's requests close with its own turn instead of later reading "answered outside Inline" - register sub-agent threads from thread/started (parentThreadId), so a request that beats the spawn item is still shown; a request from a thread no session knows is refused with a "Request declined" notice in the chat - titled single and multi-select choices (oneOf, anyOf, items.anyOf) are choices, answered with their values - a command approval always offers a way to say no - contract fixture for the mcp tool approval wire shape
…stop for turnless requests - golden card fixture for a Codex MCP tool approval - every question card ends with Cancel, answered as the harness's cancel (Codex, Claude, ACP and OpenCode all take it); with eight options it shares the last row, within Inline's eight-row limit - /stop with no turn running cancels open requests that wait on no turn (not a sub-agent's, not an asynchronous question) instead of answering "Nothing is running." - fault tests: a tool card answers once, Cancel answers its own card, a withdrawn card reaches nothing; question cancel and turnless stop - bridge doc: Codex MCP tool cards, question Cancel, turnless /stop
morajabi
force-pushed
the
claude/codex-mcp-approvals-734f0b
branch
from
November 23, 2026 15:17
2fc5274 to
28284f3
Compare
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.
Why
When Codex asks to run an MCP tool, Inline showed only the line
Allow the coolify MCP server to run tool "manage_notifications"?, with nothing to press. Codex waited until someone ran/stop.Codex sends these as a form elicitation with an empty
requestedSchemaand_meta.codex_approval_kind: "mcp_tool_call". Main mapped that to a question with zero fields: no buttons, no answer path.This PR also closes the other Codex cases from the stuck-prompt audit that live in the same code.
What changes
Codex MCP tool approvals (
crates/agent-driver-codex)server · tool"tui/src/bottom_pane/mcp_server_elicitation.rs): Allow, Allow for this session / Always allow only when_meta.persistallows them, and Cancel._meta.codex_approval_cancellation_reason: "user", as the TUI does.{"action":"accept","content":null,"_meta":{"persist":"session"}}.Unanswered and stale cards
turnIdis nullable. A request without one now belongs to its thread's running turn, so its card closes ("No longer needed") when that turn ends or is interrupted.Other stuck-prompt cases from the audit
thread/started(parentThreadId), so a request that arrives before the spawn item still shows a card. A request from a thread no session knows is still refused (-32601). The chat now says so with an error-level "Request declined" notice, titled the way Claude's declined requests are in bridge: stop prompts from leaving a turn stuck (card refusals, claude questions and mcp forms) #168. Error level matters because the renderer only shows Error notices. Codex's existingcancel_dialogwas already visible through its Dialog callout, so it is unchanged.oneOf,anyOf,items.anyOf) are choices answered with their values. Before, they fell back to a free-text answer.cancelis added when no decline or cancel survives filtering./stopwith no turn running cancels open requests that wait on no turn, instead of replying "Nothing is running." A sub-agent's requests and asynchronous questions are left alone.Wire and contract notes
33b3f80a(2026-11-07), and pinned in a new contract fixture:crates/agent-bridge/tests/fixtures/harness/codex/mcp-tool-approval.json.ActionData) gains aqx(Dismiss) variant. Only the bridge reads it.Tests
manage_notifications); Allow, Allow for this session, Cancel; a card closed at turn end with a nullturnId; a sub-agent registered fromthread/startedwhose card closes with its turn; the argument bounds and cleaning; titled multi-select; command cards that can always say no; the unknown-thread notice.blocks/fixtures/approval/codex-mcp-tool. Fault tests through the work actor: Allow answered once, a second press gets "no longer pending", Cancel answers its own card, a withdrawn card closes with no buttons and a late tap reaches nothing, question Cancel, and/stopwith no turn leaving an asynchronous question and a turn-bound request open. An exactly-8-option question stays within 8 rows.cargo test -p inline-agent-driver-codex -p inline-agent-bridge,cargo test -p inline-cli bridgeandcargo clippy --all-targetson those crates all pass.Left out (follow-ups)
serverRequest/resolvedever arrives beforeturn/completed, a withdrawn card would still read "Answered outside Inline". Codex sends it after the turn event (it goes through the thread listener), so this was not observed.🤖 Generated with Claude Code