Skip to content

fix(codex): handle MCP tool approval elicitation separately#1079

Open
pokoynik wants to merge 1 commit into
OasAIStudio:mainfrom
pokoynik:fix/mcp-elicitation-approval
Open

fix(codex): handle MCP tool approval elicitation separately#1079
pokoynik wants to merge 1 commit into
OasAIStudio:mainfrom
pokoynik:fix/mcp-elicitation-approval

Conversation

@pokoynik
Copy link
Copy Markdown

Problem

mcpServer/elicitation/request for MCP tool approvals could fall through Symphony's generic approval handling.

In practice, this caused Codex app-server turns to appear stuck while waiting on Linear MCP save_comment approvals. The runtime log showed the turn hanging on mcpServer/elicitation/request until timeout or shutdown.

Root cause

The client did not have dedicated handling for MCP tool approval elicitations. Because the payload contains approval-related metadata (_meta.codex_approval_kind = "mcp_tool_call"), it matched the generic approval path and replied with:

{ "approved": true }

But Codex app-server expects an MCP elicitation acceptance payload shaped like:

{ "action": "accept", "content": {}, "_meta": { "persist": ... } }

That meant the elicitation was not actually resolved, so the app-server kept waiting.

Fix

  • add dedicated detection for mcpServer/elicitation/request with codex_approval_kind = "mcp_tool_call"
  • reply with the expected MCP acceptance payload
  • preserve persist semantics (always / session) from the elicitation metadata
  • keep this handling ahead of the generic approval branch
  • add regression coverage with a fake app-server scenario that verifies the accepted payload shape

Validation

I ran:

  • corepack pnpm test
  • corepack pnpm typecheck
  • corepack pnpm build
  • corepack pnpm exec biome check src/codex/app-server-client.ts tests/codex/app-server-client.test.ts tests/fixtures/codex-fake-server.mjs

All of the above passed locally.

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.

1 participant