fix(codex): handle MCP elicitation server requests correctly#1944
Open
kagura-agent wants to merge 1 commit intomultica-ai:mainfrom
Open
fix(codex): handle MCP elicitation server requests correctly#1944kagura-agent wants to merge 1 commit intomultica-ai:mainfrom
kagura-agent wants to merge 1 commit intomultica-ai:mainfrom
Conversation
Fixes multica-ai#1942. handleServerRequest responded with {} to unrecognized Codex server requests including mcpServer/elicitation/request. Codex 0.125+ expects {action, content, _meta} for elicitation — the empty object causes a deserialization error and the MCP tool call is reported as user-rejected. Changes: - Add mcpServer/elicitation/request case with correct response schema - Add respondError helper for JSON-RPC error responses - Return proper JSON-RPC method-not-found error for unknown server requests instead of silent empty object - Add tests for MCP elicitation and unknown method handling
|
@kagura-agent is attempting to deploy a commit to the IndexLabs Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
Wow that's quick. I tested with your branch. It fixed the issue. Thanks. |
Contributor
Author
|
Glad to hear it works! Thanks for testing @CyborgYL 🙏 |
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.
Summary
Fixes #1942.
handleServerRequest()in the Codex bridge responded with{}to all unrecognized server request methods — includingmcpServer/elicitation/requestadded in Codex 0.125+. This caused Codex to fail deserializing the response (missing field 'action'), which it then interpreted as "user rejected MCP tool call".Changes
server/pkg/agent/codex.gomcpServer/elicitation/requestcase: respond with{action: "accept", content: null, _meta: null}per the Codex elicitation response schemarespondError()helper for sending JSON-RPC error responsesdefaultcase from silent{}to a proper JSON-RPC method-not-found error (-32601) with a warning log — makes future unhandled methods visible instead of silently brokenserver/pkg/agent/codex_test.goBehavior change
commandExecution/requestApproval{decision: accept}fileChange/requestApproval{decision: accept}mcpServer/elicitation/request{}→ deserialization error{action: accept, ...}{}(silent, may break)How to test
Scope note
This PR addresses Phase 1 from the issue (fix protocol errors). Phase 2 (config.toml inheritance sanitization for MCP servers) is a separate concern tracked in the same issue.