Repository navigation
Route Claude MCP elicitation requests to the input prompt (#173) - #1579
Conversation
The Claude provider answered every non-can_use_tool control request with
an error, so MCP servers asking the user mid-run never reached them.
Elicitation requests now reuse Codex's pendingFromInput (same InputPrompt
card and schema validation) and reply { action, content? } to the CLI.
Closes #173
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba323d9996
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| mode: request.mode, | ||
| url: request.url, | ||
| elicitationId: request.elicitation_id, | ||
| requestedSchema: request.requested_schema, |
There was a problem hiding this comment.
Accept URL elicitations without correlation IDs
When a valid Claude URL-mode elicitation omits elicitation_id, this call passes undefined into pendingFromInput, whose URL branch rejects the request and sends an unsupported-elicitation error instead of displaying the authentication link. Claude's protocol explicitly makes elicitation_id optional, including for URL mode, so the Claude adapter needs provider-specific validation rather than inheriting Codex's requirement. See the published Claude Agent SDK types.
Useful? React with 👍 / 👎.
| markTurnContent(); | ||
| e.pendingPermissions.push(pending); |
There was a problem hiding this comment.
Remove elicitations canceled by the CLI
If Claude emits control_cancel_request while this elicitation is awaiting an answer, the newly queued entry is never removed because the event handler only dispatches control_request. The thread therefore remains marked awaitingInput with a stale card, and a later click attempts to answer a request the CLI has already canceled. The stream protocol explicitly defines this stdout message as canceling an open control request; handle it by matching request_id, removing the pending entry, and refreshing the waiting state. See the Claude Agent SDK control types.
Useful? React with 👍 / 👎.
Problem
The Claude provider answered every control request other than
can_use_toolwithUnsupported control request. MCP elicitations (a server asking the user mid-run) were auto-errored and never reached the user (#173).Fix
electron/runner-provider-claude.js:elicitationcontrol requests (mcp_server_name,message,mode,url,elicitation_id,requested_schema) go through Codex's existingpendingFromInput. That reuses theInputPromptcard, the form-schema validation and the URL rules. Forms that can't be displayed get an explicit error reply, which the CLI treats ascancel.electron/runner-permissions.js: answers to elicitation prompts reply{action, content?}. Allow becomesacceptwith the validated values, Deny becomesdecline, and Cancel stayscancel. Values that fail the schema throw before anything is sent, so the prompt stays open.The wire shape was checked against the claude 2.1.283 binary, which answers elicitations from the host by default (
hostAnswersElicitations).Tests
guardrails-runner.test.js: the fake CLI can now send any control request. New cases cover accept-with-content (after a rejected bad value), decline, and the error reply for a form that can't be displayed.npm run test:electron: 4525 pass, 0 fail.Not tested against a real MCP server in the live app.
Closes #173
🤖 Generated with Claude Code