Repository navigation
codex-companion: task --write runs Codex's Auto preset (guardian-reviewed escalation) - #57
Conversation
The amigo task verb's headless default (approvalPolicy "never") was the
only option: the vendored app-server client rejects every server-initiated
request with -32601, so an interactive approval policy would have denied
every escalation at the wire. Codex's native auto-review guardian removes
that constraint — with approvals_reviewer=auto_review, boundary-crossing
approval requests are judged by a server-side reviewer subagent and never
reach the client.
--auto wires that up: workspace-write sandbox (implies --write),
approvalPolicy "on-request" on thread/start AND thread/resume, and a
task-owned app-server spawn carrying -c approvals_reviewer=auto_review
(the reviewer is config-level, not a thread param, so the auto lane cannot
share a broker's server).
Verified live against codex-cli 0.146.0: an out-of-workspace write under
--auto triggered a real guardian session (rollout shows the risk-framework
policy and its {"outcome":"allow"} verdict) and the escalated command
ran; the plain --write lane still sends approvalPolicy "never" with an
untouched argv, pinned by tests/codex-companion/test-task-auto.mjs against
the mock app-server's own records.
…s config
Independent review (gpt-5.6-sol) caught the gap: thread/resume restores
the approvals reviewer persisted at thread creation, which beats the
process-level -c override — so upgrading a plain-created thread with
--auto --resume-last left reviewer "user", and the approval RPC landed
on this client's reject-everything handleServerRequest. Reproduced live
under a scratch CODEX_HOME with the default reviewer: the escalated
command was refused exactly as predicted.
Fix: send approvalsReviewer ("auto_review" when --auto, null otherwise)
in both thread/start and thread/resume params. The wire field exists in
codex-cli 0.146.0 next to approvalPolicy. With the reviewer on the thread
itself, the config override and the private app-server spawn it forced
are unnecessary — the auto lane now shares transports like every other
task. Re-verified live under the scratch home: fresh --auto and
plain-to-auto resume both escalate through a real guardian session
(three reviewer rollouts recorded); the mock-level test now pins the
plain-to-auto resume params as the regression case.
… --auto flag Human call: guardian review only costs when an escalation is actually requested (in-sandbox work never triggers it), so a separate opt-in flag guarded nothing worth guarding. --write now selects workspace-write plus approvalPolicy "on-request" and approvalsReviewer "auto_review"; read-only tasks keep approvalPolicy "never". No caller depended on the old never-policy write lane (grepped skills/ and tests/).
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 916ccb1d63
ℹ️ 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".
| cwd, | ||
| model: options.model ?? null, | ||
| approvalPolicy: options.approvalPolicy ?? "never", | ||
| approvalsReviewer: options.approvalsReviewer ?? null, |
There was a problem hiding this comment.
Keep the vendored runtime byte-identical
This edits a file covered by skills/codex-companion/runtime/VENDORED-FROM, which explicitly marks scripts/ as byte-identical vendor content and says behavior changes must remain at call sites or in skill documentation. The next refresh from the pinned upstream plugin will therefore overwrite this reviewer propagation and break the new --write behavior; implement the adaptation outside the vendored tree or update the vendor source/pin and provenance together.
Useful? React with 👍 / 👎.
sminos plane: a DX4 chunk carries the bridge's stamp t (MAWS #57) (7.183.2)
What problem are you trying to solve?
The amigo
taskverb's headless client rejects every server-initiated RPC with -32601, so the only viable approval policy was"never"": a--write` task that legitimately needed to cross the sandbox (network, files outside the workspace) simply failed there, with no escalation path.Codex's native auto-review guardian (
approvals_reviewer = "auto_review", stable in codex-cli 0.146.0) removes that constraint: boundary-crossing approval requests are judged by a server-side reviewer subagent and never reach the client.What does this PR change?
--writenow runs Codex's Auto preset: workspace-write sandbox plusapprovalPolicy "on-request"andapprovalsReviewer "auto_review"on boththread/startandthread/resume. Read-only tasks keep"never". Guardian review only costs when an escalation is actually requested, so in-sandbox work is unaffected — which is why it's the writer default rather than a separate flag (a--autoflag was built first, then collapsed on that reasoning).Review history
An independent gpt-5.6-sol review of the first cut caught a real bug: the reviewer was passed as a
-cprocess config override, butthread/resumerestores the reviewer persisted at thread creation, which beats process config — upgrading a plain-created thread routed approval RPCs to the reject-everything client. Reproduced live under a scratchCODEX_HOMEwith the default (user) reviewer, fixed by carrying the reviewer in the thread params, re-verified live (guardian rollout sessions show the risk-framework policy and{"outcome":"allow"}). Second review round: clean.Verification
tests/codex-companion/test-task-auto.mjspins the wire params for all three lanes against the mock app-server's own records; asserts fail against the parent commit.🤖 Generated with Claude Code
https://claude.ai/code/session_014L9o6WePUkWGrtbHMeLwLa