Skip to content

fix(#1079): enable network access for codex workspace-write phases - #1083

Merged
admarble merged 1 commit into
mainfrom
fix/1079-codex-network-access
Sep 18, 2026
Merged

admarble merged 1 commit into
mainfrom
fix/1079-codex-network-access

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Fixes #1079. Sibling of #1076 (PR #1077), in the same function.

Summary

Codex's workspace-write sandbox disables network access by default, so every codex phase ran offline: it could not gh issue view the issue it was working on, could not post a /spec plan or a QA verdict comment, and could not git push.

buildCodexArgs now passes

-c 'sandbox_workspace_write.network_access=true'

whenever the resolved sandbox mode is workspace-write, with a new run.codex.networkAccess setting (default true) to opt out. read-only and danger-full-access are untouched, exactly as with #1076's writable-root override.

Why this was invisible until now

The first #1060 gate run left no /spec comment on its subject issue and the orchestrator logged Could 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: false is 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:

$ codex sandbox -c 'sandbox_mode="workspace-write"' \
    -c 'sandbox_workspace_write.writable_roots=["…/.git"]' \
    -c 'sandbox_workspace_write.network_access=true' \
    -- sh -c 'gh issue view 1079 --json number --jq .number'
1079

Without the network override the same command fails outright. All $0 — codex sandbox makes no model call, though it defaults to read-only, so a probe must pass sandbox_mode explicitly 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 in codex.test.ts needed the new -c pair.

A trap #1076 left behind: its writableRootsArg helper matched the sandbox_workspace_write. namespace by prefix, so it silently began reporting this new override as the writable root. It now matches the full writable_roots= prefix, with a separate helper for network_access=.

Mutation-verified: AC — replaced the sandboxMode === "workspace-write" && (settings?.networkAccess ?? true) guard with false; exactly three tests failed (1079 enables network access under workspace-write by default plus the two 497 AC-2 exact-array tests), 66 others passed; restored to a clean tree.

Test plan

  • npm run lint
  • npm run build
  • npm test — 319 files, 6443 passed, 0 failed, 1 expected fail, 3 skipped
  • Real-sandbox check above (gh blocked → returns 1079)
  • Mutation-verified

Provenance

A cloud routine implemented this first and reached the same design independently, then could not push: both git push and the GitHub MCP create_branch returned 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.

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
@admarble
admarble merged commit 0dc1cbb into main Sep 18, 2026
6 checks passed
@admarble
admarble deleted the fix/1079-codex-network-access branch September 18, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(codex): workspace-write disables network, so every phase runs offline — no gh, no comments, no push

1 participant