codex: put gated actions in the approval pane, and hide what codex cannot do - #9
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two changes that finish the modes on codex.
Approvals
codex raised a gating request and cathode auto-refused it, so
askandplancould not run a tool at all. The request now goes to the same pane claude uses — the engine emits the sharedpendingApprovalMsg, 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:
askasks, and the approved file is actually written to disk.Two things had to move off the reader goroutine
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
/syspromptis delivered as a claude output style and/mcpreads claude's init line, so both did nothing on codex while still being offered.slashCmd.onlynow declares which backends a command works on, and the palette, the help text and the dispatcher all askavailableOn.Selecting one anyway is handled, not forwarded — falling through would send the literal
/syspromptto 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 ownitem/tool/requestUserInput(its question equivalent), which currently gets a-32601.