Repository navigation
fix(#1079): enable network access for codex workspace-write phases - #1083
Merged
Merged
Conversation
codex's workspace-write sandbox disables network access by default, so every codex phase ran offline: it could not gh issue view its own issue, post a spec plan or QA verdict comment, or git push. The first #1060 gate run showed it — no spec comment was posted, the orchestrator logged 'Could not parse spec recommendation', and the exec agent reconstructed its task by grepping the repo for the issue number because it could never read the issue. buildCodexArgs now passes -c sandbox_workspace_write.network_access=true under workspace-write, with run.codex.networkAccess (default true) to opt out. This widens the sandbox deliberately: a codex phase reaches the network as a Claude Code phase already does, and the alternative is a driver whose phases cannot participate in the workflow at all. The #1076 test helper matched the sandbox_workspace_write. namespace by prefix, so it would have started reporting this second override as the writable root; it now matches the full writable_roots= prefix. Entire-Checkpoint: 75b9867a9ed5
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.
Fixes #1079. Sibling of #1076 (PR #1077), in the same function.
Summary
Codex's
workspace-writesandbox disables network access by default, so every codex phase ran offline: it could notgh issue viewthe issue it was working on, could not post a/specplan or a QA verdict comment, and could notgit push.buildCodexArgsnow passeswhenever the resolved sandbox mode is
workspace-write, with a newrun.codex.networkAccesssetting (defaulttrue) to opt out.read-onlyanddanger-full-accessare untouched, exactly as with #1076's writable-root override.Why this was invisible until now
The first #1060 gate run left no
/speccomment on its subject issue and the orchestrator loggedCould not parse spec recommendation. I read that as a parser quirk at the time. It was the network: the phase could not reach GitHub at all. The exec agent still produced a correct fix — by grepping the repo for the issue number and reconstructing the task from code, because it could never read the issue body.The scope trade, stated plainly
This widens the sandbox: a codex phase can reach the network, as a Claude Code phase already can. The alternative is a driver whose phases cannot participate in the workflow at all — no spec comment, no QA verdict, no PR.
networkAccess: falseis there for anyone who would rather have sealed phases, and a test asserts that sealing the network still leaves the writable root intact, since a sealed phase must still be able to commit.Verification
Real sandbox, using the exact flags the driver computes for a worktree:
Without the network override the same command fails outright. All $0 —
codex sandboxmakes no model call, though it defaults to read-only, so a probe must passsandbox_modeexplicitly or it proves nothing.Four tests added to
codex.sandbox.integration.test.ts(default on,networkAccess: false, and both other sandbox modes). Two pre-existing exact-array tests incodex.test.tsneeded the new-cpair.A trap #1076 left behind: its
writableRootsArghelper matched thesandbox_workspace_write.namespace by prefix, so it silently began reporting this new override as the writable root. It now matches the fullwritable_roots=prefix, with a separate helper fornetwork_access=.Mutation-verified: AC — replaced the
sandboxMode === "workspace-write" && (settings?.networkAccess ?? true)guard withfalse; exactly three tests failed (1079 enables network access under workspace-write by defaultplus the two497 AC-2exact-array tests), 66 others passed; restored to a clean tree.Test plan
npm run lintnpm run buildnpm test— 319 files, 6443 passed, 0 failed, 1 expected fail, 3 skippedghblocked → returns 1079)Provenance
A cloud routine implemented this first and reached the same design independently, then could not push: both
git pushand the GitHub MCPcreate_branchreturned 403, "Claude doesn't have GitHub access to sequant-io/sequant for your organization." That work was stranded in an ephemeral container, so this branch is a local reimplementation. The GitHub App install is worth fixing before relying on cloud routines against this repo.With this and #1076 merged, the #1060 gate can re-run and actually reach G-4, G-5 and G-6.