Skip to content
This repository was archived by the owner on Feb 14, 2026. It is now read-only.

fix: handle approval elicitation responses#114

Closed
XindanZhang wants to merge 1 commit intoslopus:mainfrom
XindanZhang:codex-action
Closed

fix: handle approval elicitation responses#114
XindanZhang wants to merge 1 commit intoslopus:mainfrom
XindanZhang:codex-action

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
@felixgenicio
Copy link

I'm testing happy and experimenting this when trying to use the mobile app and codex. The issue is marked as closed, but there's no reference to any fix. Is it solved in other way?

@XindanZhang
Copy link
Author

Hi,thanks for your reply. It works on my side. I closed it just because i feel like this PR will not be merged

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants