Skip to content

codex: put gated actions in the approval pane, and hide what codex cannot do - #9

Merged
tdwd merged 1 commit into
mainfrom
codex-approvals
Sep 9, 2026
Merged

tdwd merged 1 commit into
mainfrom
codex-approvals

Conversation

@tdwd

@tdwd tdwd commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Two changes that finish the modes on codex.

Approvals

codex raised a gating request and cathode auto-refused it, so ask and plan could not run a tool at all. The request now goes to the same pane claude uses — the engine emits the shared pendingApprovalMsg, so the y/n bar, the diff card, the question picker and the build-mode short-circuit are all reused. The only codex-specific part is turning a decision back into a JSON-RPC reply.

All four modes work now. Verified live: ask asks, and the approved file is actually written to disk.

Two things had to move off the reader goroutine

  • It must keep draining while the pane is up, or the item events that draw the very card being approved never arrive.
  • Approvals are admitted one at a time. The UI holds a single pending approval, so a second would overwrite the first and leave codex waiting on a reply that can no longer be given. claude cannot hit this — its approvals are pulled one at a time by waitApproval; codex pushes, so the engine has to serialise.

That second one is a deadlock the tests now pin, and the test is discriminating: removing the slot fails it.

Capabilities

/sysprompt is delivered as a claude output style and /mcp reads claude's init line, so both did nothing on codex while still being offered. slashCmd.only now declares which backends a command works on, and the palette, the help text and the dispatcher all ask availableOn.

Selecting one anyway is handled, not forwarded — falling through would send the literal /sysprompt to the agent as a prompt, which reads as the command doing something strange rather than not existing.

Verified

go vet, full suite, and all four live tests against the real CLI (CATHODE_CODEX_LIVE=1).

Still claude-only and now correctly hidden: /sysprompt, /mcp. Still missing on codex: session replay, /compact, and codex's own item/tool/requestUserInput (its question equivalent), which currently gets a -32601.

…nnot do

Two changes that finish the modes.

Approvals. codex raised a gating request and cathode auto-refused it, so ask
and plan could not run a tool at all. The request now goes to the same pane
claude uses: the engine emits the shared pendingApprovalMsg, so the y/n bar,
the diff card, the question picker and the build-mode short-circuit are reused,
and the only codex-specific part is turning a decision back into a JSON-RPC
reply. All four modes work now, verified live — ask asks, and the approved file
is actually written.

Two things had to move off the reader goroutine. It must keep draining while
the pane is up, or the item events that draw the very card being approved never
arrive. And approvals are admitted one at a time: the UI holds a single pending
approval, so a second would overwrite the first and leave codex waiting on a
reply that can no longer be given. claude cannot hit that because its approvals
are pulled one at a time; codex pushes, so the engine serialises them.

Capabilities. /sysprompt is delivered as a claude output style and /mcp reads
claude's init line, so both did nothing on codex while still being offered.
slashCmd now declares the backends it works on, and the palette, the help text
and the dispatcher all ask the same question. Selecting one anyway is handled,
not forwarded — falling through would send the literal "/sysprompt" to the
agent as a prompt.
@tdwd
tdwd merged commit c0ec394 into main Sep 9, 2026
1 check passed
@tdwd
tdwd deleted the codex-approvals branch September 9, 2026 11:06
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