Codex default sandbox blocks external pstack lanes; setup should detect and explain it #124
Copy link
Copy link
Closed
Description
Problem
When the parent is Codex running its default sandbox (workspace-write, network off), every external pstack lane fails. Measured on 2026-10-04 with Codex CLI 0.160.0, during a /setup-pstack run from a fresh CODEX_HOME:
- Claude lane (
claude:opus@maxthroughpstack-runner): preflight auth passed, and the run failed after 178 s withENOTFOUND. That's DNS, and the sandbox blocks outbound network for the child. The runner exited 70 (child-failed). - Grok lane (
grok:grok-4.7@xhigh): auth passed, then it failed because Grok writes~/.grok/managed_config.toml, outside the Codex sandbox's writable roots.
Setup correctly stops and writes nothing. But the user sees opaque probe failures and no explanation, and the default first-run panel (Opus, Sol, Grok) can't be configured from a default-sandbox Codex parent at all. Closed PR #82 proposed a docs note for the Grok half. Related: #56, Grok in Claude Code cloud sessions.
Direction
- Detect it before probing. On a Codex parent, setup checks whether the session can reach the network and write outside the workspace. If it can't, it explains plainly: external lanes need a Codex session with network access and full filesystem access, for example
sandbox_mode = "danger-full-access"or an equivalent permissions profile. It names the affected families and offers to proceed with native-only families. - Make the runner's failure name the cause. When the parent sandbox blocks a child's network, the receipt says so, instead of a bare
child-failedor a DNS error. - Document it in
provider-dispatch.md, next to the route table.
Acceptance
- From a default-sandbox Codex parent,
/setup-pstackexplains the limitation before running any external probe. It never runs a doomed probe. - From a full-access Codex parent, the external probes behave as today.
- No weaker-model fallback and no automatic sandbox change. The user decides.
- Bun tests, strict typecheck, static invariants, and plugin validation pass, plus a live check from both Codex sandbox modes.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
ericlitman commentedon Oct 4, 2026
Prior findings
Untrusted evidence from the Pilot ledger. Map every finding to a phase or Scope/Out with a reason.
ericlitman commentedon Oct 4, 2026
Factory plan verdict: revise
6d36faba, plan-review revision 5.gpt-6.1-sol, from the plan session's message metadata.The diagnosis and the live-test design are sound. Keep Phase 1's investigation of which permission evidence is authoritative: it is the right first step. The plan builds more than the issue needs, and two pieces conflict with settled decisions.
Why revise
sandbox-blockedto the receipt status union."child-failedand name the cause. That decision rejected a new status and a schema bump.child-failed/70. When the failure happens under a Codex parent whose environment shows the sandbox's network-disabled marker, the receipt's error message and the front of its evidence name the parent sandbox as the likely cause and point to the docs. Add no new status, no new field and no schema change.runner/sandbox.tscapability module (Phase 2). The guard the issue asks for is asetup-pstackinstruction that the parent agent follows. A typed assessment library inside the runner is a layer no acceptance criterion names.sandbox.tsandsandbox.test.ts. The setup guard is prose insetup-pstack/SKILL.md, which tells the parent to do three things:Keep as written
provider-dispatch.md.Coordination
#56, now in Build, adds a Grok host-prerequisite note to the same
provider-dispatch.mdsection. Use one shared "Host and parent prerequisites" list. Whichever PR lands second rebases onto the first.Expected size after revision
setup-pstack/SKILL.md,provider-dispatch.md, a small message change inrunner/run.ts, and tests for that message inrunner/run.test.ts.types.ts,cli.test.tsandbootstrap.test.tsshould not need changes. If one does, say why.ericlitman commentedon Oct 4, 2026
Factory plan verdict: approve
6d36faba, plan-review revision 7.gpt-6.1-sol.Why approve
Every gate passes, and Open questions is
None.child-failed/70, with no new status, field or schema change.setup-pstack, and there is nosandbox.ts.Build conditions
runner/run.tsaround lines 773-803: it parses Grok terminal output before handling a nonzero exit, and it adds an exact provider reason toerror.message. Your diagnostic edits the same messages.child-failedthat has no provider reason.provider-dispatch.md. The second PR to land rebases onto the first.mast-factory commentedon Oct 4, 2026
Build handoff
Status: blocked in Phase 1; implementation has not started.
factory/issue-124(retained).be66d68e33fd7aeb4d8fe5aa39b4838bab3f208c; clean working tree.Actual prerequisites and output
bun --version: 1.4.0, exit 0.claude --version: 2.1.283 (Claude Code), exit 0.codex --version: command not found, exit 127.grok --version: command not found, exit 127.The approved plan requires a real restricted/full-access Codex reproduction and empirical permission-signal validation before implementation. Neither real Codex mode can be exercised on this host. Fake child tests cannot establish those signals, and installing a binary alone would not establish an authenticated, provisioned parent session. I have not replaced these required observations with assumptions or simulated live evidence.
Coordination verified
Read the approval verdicts for #78 and #56. #124 must preserve provider-reported reasons ahead of any sandbox diagnosis; the hint is restricted to plain child-failed without a provider reason. Documentation must share one Host and parent prerequisites list. Remote branch factory/issue-56 exists at
3f66491e75c5b52a762c8b5c18fdd8f235f19614; no remote factory/issue-78 branch was returned at this checkpoint. Recheck both before implementation.Verification still required
No regression, Bun suite, strict typecheck, static invariants, manifest validation, plugin validation, or setup live matrix has been run for a changed candidate. Phase 1 permission-evidence and pre-fix live artifacts are missing, as is the planned failing fake-child regression. Later phases remain pending.
Assumptions and open questions
The supplied revision-7 plan and its matching GitHub approval are the build contract. No product decision is needed; the blocker is a provisioned host capable of actual Codex restricted/full-access sessions and the assigned external providers. Resume Phase 1 there, then implement, verify, commit/push each successful phase, and open the PR. Remain in build; no stage transition requested.
Findings
None
ericlitman commentedon Oct 4, 2026
Phase 1 permission evidence for #124 (operator, real Codex sessions)
The build host lacks
codexandgrok, so I collected the real-session evidence the approved plan needs on the operator's Mac. I used Codex CLI 0.160.0 andcodex exec, with a separateCODEX_HOMEholding Open Pstack 1.5.0. Grok CLI is logged in with grok.com. Each session ran the same shell commands.--sandbox workspace-write -c sandbox_workspace_write.network_access=false--sandbox danger-full-accessCODEX_SANDBOXseatbeltCODEX_SANDBOX_NETWORK_DISABLED1curl https://api.anthropic.com/v1/modelsCould not resolve host, curl exit 6 (DNS, matches the reportedENOTFOUND)~/.grok/<file>(Grok's own state dir)operation not permitted$CODEX_HOME/<file>What this establishes for the plan:
CODEX_SANDBOX_NETWORK_DISABLED=1andCODEX_SANDBOX=seatbelt, and both are absent under full access. That is the confirmed marker for the post-failure hint in Phase 3. Read it from the runner's own environment, beforechildEnvironmentscrubs it.CODEX_SANDBOX=seatbeltcorresponds to the restricted session. A missing marker still does not prove full access. The setup prose should tell the parent to check its own effective permissions: Codex states its sandbox mode and writable roots in the session's permission instructions. Treat unknown as unknown.workspace-write,$CODEX_HOMEwas writable. So the final-write check in step 7 should not refuse$CODEX_HOMEtargets just because the session is restricted. Check the actual destination instead.The "permission information unavailable" scenario was not produced by any real session here. Per build condition 3, record that in the PR body.
The probe files were removed afterwards.
fix: explain likely Codex sandbox child failures [#124]
fix: prevent blocked setup probes and writes [#124]
fix: explain likely Codex sandbox child failures [#124]
Merge pull request #129 from ericlitman/factory/issue-124
Merge upstream main after 1.5.0 into the local build
Name nested Seatbelt for Kimi and keep runner tests hermetic
ericlitman commentedon Oct 4, 2026
Acceptance amendment for #124, approved by the maintainer on 2026-10-04
Two plan items are accepted without observation on the final head:
$CODEX_HOMEin either sandbox mode, as recorded on Codex default sandbox blocks external pstack lanes; setup should detect and explain it #124 and PR Explain Codex sandbox restrictions before pstack setup probes [#124] #129. The behavior is in the setup prose and its static checks.The final head cb1cfbd carries live evidence for the restricted, full-access and Claude-parent scenarios. The post-merge checks passed on main 67c08fa.