fix(codex): full access no longer asks to approve commands and patches #38783
main fromrefs/pull/38783/head·opened View on GitHubProblem#
A Codex thread in Full access still stops for approvals. Example: a delegated Codex reviewer ran a shell command containing trap 'rm -rf "$test_dir"' EXIT, and T3 showed "Approval needed" for it. The turn waited until the user clicked Approve.
This is a regression from #37104. For MCP prompts to reach T3, Full access moved Codex from approvalPolicy: "never" to a granular policy. Under granular, Codex's own checks can still raise item/commandExecution/requestApproval and item/fileChange/requestApproval. A command Codex judges dangerous, such as rm -rf, is one of these. T3 auto-accepts MCP elicitations in Full access but not these two, so they reach the user. Every other provider treats Full access as no prompts (Cursor, OpenCode, Kiro).
Expected: Full access never asks the user to approve a command or patch.
Change#
The command and file-change approval handlers in CodexAdapterV2 answer accept themselves when the turn is Full access and has no explicit approvalPolicy or sandboxPolicy override. The MCP elicitation handler already does this. An explicit override still sends prompts to the user, as do the supervised modes. The turn policy sent to Codex does not change, so the browser and app access fix from #37104 is unaffected.
Scope#
A small fix for a regression in #37104 with a concrete reproduction above, so I did not open a separate issue.
Verification#
- New test
accepts command and patch approvals in Full access without asking. It replays a Full access turn in which Codex requests approval for anrm -rfcommand and for a patch. The test expects T3 to answeraccepton the wire and emit noruntime_request.updated. It fails without the source change (times out waiting for a prompt) and passes with it. - Two file-change approval tests (
answers without waiting for late paths…andmatches file paths to items approved out of order) drive the user's prompt. They ran in the default Full access policy, so they now start inauto-accept-edits, which is the supervised path they test. - The whole
CodexAdapterV2.test.tspasses (205 tests).node scripts/check-changed.tspasses format, lint, knip, graphql, typecheck and tests. - Not checked: a manual run in the desktop app with this build.
Code written by Claude Opus 5.5 (Claude Code).
🤖 Generated with Claude Code
- 1
- 2
Pushedf1fcef3
juliusmarminge added labelstakeover:needs-julius
juliusmarminge removed labelstakeover:in-progress
Thanks for this. #39187 makes the same change and is the one being kept.
#39187 fixes the same command and patch approval regression, while distinguishing ordinary approvals from terminal input, managed-network requests, and grants for broader write access. This change accepts those requests indiscriminately under the default Full access policy.
Your command reproduction and the requirement to respect explicit policy overrides remain covered by the retained fix, which also adds regression coverage for those request distinctions.
Closing as a duplicate.
juliusmarminge closed this
Sign in to join this conversation.
Evidence#
In the web client, use authenticated Codex 0.169.0 with GPT-6-Luna, Medium reasoning, Full access, and no command rules or explicit policy overrides. Submit:
Execute the shell command rm -rf ./absent-repro-target exactly, then report its exit code.Do not approve anything. Both sides use fresh isolated app state, a synthetic scratch project, Chromium at 1280×800 CSS pixels, and light theme.Seed script · Reproduction instructions
Not shown: