Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 26de9b1729
ℹ️ 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".
| } else { | ||
| const pending = this.pendingExecApprovals.shift(); | ||
| if (pending) { | ||
| toolCallId = pending.callId; | ||
| toolInput = { | ||
| command: pending.command, | ||
| cwd: pending.cwd, | ||
| reason: pending.reason ?? undefined |
There was a problem hiding this comment.
Avoid consuming exec approvals for unrelated elicitations
The new fallback path shifts pendingExecApprovals for any elicitation without Codex fields. That means an unrelated MCP elicitation (e.g., another tool asking for user input) will pop and reuse the next exec-approval entry, so the permission handler sees the wrong command/callId and the real exec approval later falls back to a random id with missing command details. This can lead to approvals/denials being applied to the wrong exec command whenever a non-Codex elicitation arrives while an exec approval is pending.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Addressed review feedback: we now only consume pending exec approvals when the elicitation looks like an exec-approval prompt (Codex message patterns / empty schema). Otherwise we leave the queue intact to avoid mismatched approvals. Commit: ea57ac3.
c3eceaf to
ea57ac3
Compare
|
very important pull, and hope merged ASAP(Codex user need this) |
Background
Users reported two related issues where Codex exec approvals either failed validation or left the session stuck after selecting “Stop and explain.” This produced invalid MCP elicitation responses and prevented follow-up messages from being processed. (Refs: #503, #522)
Solution
codex_*fields from the elicitation payload so we can reliably detect Codex exec approvals.action) while also including legacy fields (decision, optionalcontent) required by older Codex runtimes.Compatibility
This keeps compatibility with older Codex clients by continuing to send
decision/contentwhile remaining valid for the MCP schema. Non-Codex elicitation behavior is unchanged.Testing
yarn --cwd packages/happy-cli typecheck