Skip to content

Conversation

@XindanZhang
Copy link

Summary

Fixes Codex mode permission prompts where tapping “Yes” / “Yes, and don't ask…” in the mobile app did not unblock tool execution.

Problem

In happy codex, Codex requests tool approvals via MCP elicitation/create. The approval prompt shows up on mobile, but responding never successfully approves the tool call.

Root cause

  • Codex includes codex_* fields in elicitation/create params (notably codex_call_id, plus command/diff context).
  • The current handler was registered with the SDK ElicitRequestSchema, which drops unknown fields, so codex_call_id/context were lost and approvals couldn’t be correlated correctly.
  • The handler response returned only { decision }, but Codex expects an elicitation result that includes an action (accept|decline|cancel) alongside decision (approved|approved_for_session|denied|abort). Missing action causes Codex to treat the approval as invalid.

Fix

  • Use a permissive schema for elicitation/create to preserve Codex’s codex_* fields.
  • Derive a stable toolCallId from codex_call_id (fallbacks included).
  • Return { action, decision } where action is mapped from decision:
    • approved / approved_for_session → accept
    • denied → decline
    • abort → cancel

Testing

  • npm run typecheck
  • Manual: start happy codex, trigger a tool call that requires approval (exec/patch), approve from mobile; tool proceeds.

Files changed

  • src/codex/codexMcpClient.ts

@XindanZhang XindanZhang changed the title fix(codex): handle approval elicitation responses fix: handle approval elicitation responses Jan 4, 2026
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