fix: replace removed --full-auto with --sandbox workspace-write - #239
Open
zengchang233 wants to merge 1 commit into
Open
zengchang233 wants to merge 1 commit into
zengchang233 wants to merge 1 commit into
Conversation
Codex CLI 0.154.0 removed `--full-auto`, so every `codex exec` call from ask-codex.sh and the RLCR stop hook now fails with "unexpected argument '--full-auto'" (PolyArch#237). For `codex exec`, `--full-auto` only selected the workspace-write sandbox and left the headless approval policy at `never`. `--sandbox workspace-write` does exactly that and is accepted by every supported CLI (0.114.0 through 0.155.1), so no help-text probing is needed. `--approve-for-me` is not used because it also switches approvals to on-request with automatic review, which is more permissive than the old behavior. HUMANIZE_CODEX_BYPASS_SANDBOX still swaps in --dangerously-bypass-approvals-and-sandbox. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Fixes #237.
This PR fixes the bug reported in #237 and changes the two call sites listed there. It does not use the fix suggested in the issue (probing for
--approve-for-me). The reasons are in the next section.Codex CLI 0.154.0 removed
--full-auto. Everycodex execcall thatscripts/ask-codex.shorhooks/loop-codex-stop-hook.shmakes now fails immediately:This breaks
/humanize:ask-codex, both Codex passes in/humanize:gen-plan, and the summary review in the RLCR stop hook. I hit it on codex-cli 0.155.1.This PR replaces the default flag in both places with
--sandbox=workspace-write.Why
--sandbox workspace-writeand not--approve-for-meor a help-text probe#237 suggests probing
codex exec --helpfor--approve-for-me, falling back to--full-auto. I went with a plain--sandbox workspace-writeinstead:codex exec,--full-autoonly selected the workspace-write sandbox. The approval policy stayed at the headless default,never. Seecodex-rs/exec/src/lib.rsatrust-v0.114.0:full_automaps toSandboxMode::WorkspaceWrite, and the default approval isAskForApproval::Never.--approve-for-meis more permissive. It also sets the approval policy toon-requestand sends escalation requests to an automatic reviewer (codex-rs/exec/tests/suite/approval_policy.rsatrust-v0.155.1). A command the reviewer approves could run outside the sandbox. That is more than a review step needs.-s/--sandboxexists oncodex execinrust-v0.114.0(codex-rs/exec/src/cli.rs), which is the minimum version the Codex install path requires. It is also still present in 0.155.1 (codex exec --help). So the fix does not need to probe for version-specific flags the way the--disablehook-feature probe does.HUMANIZE_CODEX_BYPASS_SANDBOX=true|1still replaces the flag with--dangerously-bypass-approvals-and-sandbox, which is unchanged in 0.155.1.Changes
scripts/ask-codex.sh,hooks/loop-codex-stop-hook.sh: the defaultCODEX_AUTO_FLAGis now--sandbox=workspace-write. It is kept as a single token so the existing array expansion stays the same.docs/usage.md: theHUMANIZE_CODEX_BYPASS_SANDBOXdefault now describes--sandbox workspace-write.tests/test-ask-codex.sh: the default run passes--sandbox=workspace-writeand not--full-auto.HUMANIZE_CODEX_BYPASS_SANDBOX=1still replaces the sandbox flag.tests/test-disable-nested-codex-hooks.sh: the implementation-phase stop hook passes--sandbox=workspace-writeand not--full-auto.Deliberately left alone:
tests/test-ask-codex.sh(Test B of the--disableprobe) mentions--full-auto. It stands in for an older CLI and does not affect the flag under test.tests/test-bitlesson-select-routing.shalready asserts that the BitLesson selector never passes--full-auto, and that still holds.Testing
bash tests/test-ask-codex.sh: 39 passed, 0 failed. This includes the 2 new tests, which fail againstdevwithout the fix.bash tests/test-disable-nested-codex-hooks.sh: 7 passed, 0 failed. This includes 1 new test, which also fails without the fix and shows... --full-auto -C ...in the captured argv.bash tests/run-all-tests.sh: 2261 passed, 4 failed. The same 4 fail on unmodifieddevon my machine, for reasons unrelated to this change:test-unified-codex-config.shchecks the built-ingpt-5.5/highfallback, but my~/.config/humanize/config.jsonoverrides it. WithXDG_CONFIG_HOMEpointed at an empty dir, the file passes 69/69 on this branch.test-viz.shandtest-streaming.shneed the Pythonyamlmodule, which is not installed locally.ask-codex.sh, a realcodex execcall on codex-cli 0.155.1 succeeds (exit_code=0). Before the patch it failed withunexpected argument '--full-auto'.🤖 Generated with Claude Code