Repository navigation
Description
Epic: #497 Blocked by: #1079 Tier: human gate — not an agent run Doc: docs/investigations/codex-driver-probe-2026-09.md "Gaps" Graph: pre-2.16.0 release blockers, node 4 of 4 Subject issue: #1064
Why this is a gate and not an AC
The probe validated the harness mechanics with a 6-line skill. Whether sequant's real skills produce an acceptable phase through Codex is a paid, judgment-heavy experiment: an agent running it inside an exec phase would report NEEDS_VERIFICATION, and the vid-gen dogfood showed that verdict hid real defects 4/4. A human reads the transcript.
Setup (owner)
- Codex auth on the machine:
codex login(ChatGPT plan) orCODEX_API_KEY. Record which — the plan-auth path throughexecis inferred from SDK source, never exercised. - A small, real, open issue in this repo (docs- or test-sized) as the subject.
sequant init --agent codexapplied; project trusted per node 2.
Questions the gate answers
- G-1: end-to-end —
sequant run <issue> --agent codexthrough spec → exec → qa completes; record wall time,usagetotals, and $ from the provider dashboard. - G-2: skill-body fidelity — does
/qaact on deep sections (verdict-floor phrases, §6i mutation record), or does the body get clamped on read? Compare the transcript's skill read againstwc -c .claude/skills/qa/SKILL.md. - G-3: harness-specific references — list each stall or improvisation caused by
Task(,Agent(subagent_type,AskUserQuestion, or nestedSkill(skill: "sequant:…")(7 of 21 skills reference these). Output: the list of skills needing harness-neutral wording, or "none". - G-4:
ghunder the sandbox —gh issue commentsucceeds withnetwork_access = trueunder[sandbox_workspace_write]; note whetherdanger-full-accesswas needed. - G-5: hook deny path end-to-end — a deliberate
git push --forceinside a phase is blocked (exit 2 → Codex refuses the command), visible in the JSONL. - G-6: resume across phases — spec→exec in the same worktree resumes the thread (
canResumetrue); a forced cwd change does not.
Verdict (owner posts as a comment)
- GO → file P2/P3 as separate issues: Codex
[mcp_servers]forsequant serve;.codex/agentsmapping for the subagent-spawning skills (or harness-neutral wording); sequant as a Codex marketplace plugin (distribution, independent of the driver). - NO-GO → record the blocking finding on feat: add OpenAI Codex CLI agent driver #497 and park it; the driver stays shippable behind
--agent codexas experimental.
Related
#497 (epic) · #1058 · #1059 · #1057 (probe doc) · #972 (NEEDS_VERIFICATION hid bugs)
Release-graph plan — pre-2.16.0 blockers (2026-09-17)
Run 1 — 2026-09-16 (recorded 2026-09-17)
Subject #1064. Spec success (74s). Exec failure (805s): "exec left 5 file(s)
uncommitted and made no commits" — codex's workspace-write sandbox excluded .git/
(#1076, fixed on main by #1077 @ 34ddaa4). The uncommitted work was auto-committed to
archive/1064-gate-run1. Read against the #1064 matrix, its code is correct (forms
A–D pass, a bad message still blocks) and its test is weak (covers $(cat <<EOF),
not the -F - form that is the bug). Run log:
.sequant/logs/run-2026-09-16T06-04-25-6dc90bb3-*.json — at slot 99 of 100, copy it
before run 2 starts.
Run 2 — setup
- Blocked by bug(codex): workspace-write disables network, so every phase runs offline — no gh, no comments, no push #1079 (filed 2026-09-17):
workspace-writedisables network, so a codex phase cannot read its issue, post its spec/QA comments, or push. Run 1's spec loggedCould not parse spec recommendationand posted nothing for this reason. Land bug(codex): workspace-write disables network, so every phase runs offline — no gh, no comments, no push #1079 first; it also answers G-4 (network_access = trueunder[sandbox_workspace_write]) before the run rather than during it. - Same subject, bug(hooks): commit validator strips
#from agit commit -F -heredoc subject, blocking everytype(#N):message sent via stdin #1064, on purpose: run 1 gives a baseline (correct edits, weak test),
the~/.codex/config.tomltrust entry for thefeature/1064-…worktree path already
exists, and the weak run-1 test is a natural probe for G-2 — does/qaunder codex
flag a test that does not gate its bug (§6i)? - Preconditions measured 2026-09-17:
codex-cli 0.154.0(meets the floor);
CODEX_API_KEYunset → this run exercises the ChatGPT-plan auth path, the one
flagged above as never exercised;.codex/+.agents/provisioning already committed
on main (3527b96) — do not re-runinit --agent codexhere (bug(init): init --agent <name> on an initialized repo overwrites .sequant/settings.json with defaults #1071). - The gate's PR must clear bug(hooks): commit validator strips
#from agit commit -F -heredoc subject, blocking everytype(#N):message sent via stdin #1064's ACs as written there; that PR closes bug(hooks): commit validator strips#from agit commit -F -heredoc subject, blocking everytype(#N):message sent via stdin #1064. - A failing
/qaverdict is not posted to the issue (bug(qa): a failing qa verdict (AC_NOT_MET) is never posted to the issue — posting is gated on phase success #1070) — read the run log for
the verdict, do not wait for a comment.
Added gate question
- G-7: worktree trust — record whether the phase worktree needed its own
[projects."<path>"]entry in~/.codex/config.toml(for run 2 it pre-exists; note
what happens for a path that does not), and whether sequant should write it during
worktree setup.
Reject route / fallback
NO-GO or a codex-caused failure → record the blocking finding on #497, keep the README's
"experimental, not a supported backend" wording for 2.16.0, and run #1064 as a Claude
issue salvaging archive/1064-gate-run1's code (fix known; ~1h). The 2.16.0 tag is not
blocked by the verdict either way — the verdict decides the release-note wording.
Activity
admarble commentedon Sep 16, 2026
Gate prep — environment is ready, subject is #1064 (posted by graph-run)
#1059 merged as
59bd9a89. Everything below was verified against the merged build onmain.Verified
codex-cli 0.154.0— exactlyCODEX_MIN_VERSION; resolves on a clean login shell, so spawned phases will find it.codex login status→ Logged in using ChatGPT, so this run exercises the plan-auth path throughexec, which the probe never ran (that is G-1's "record which").~/.codex/auth.jsonis machine-level, so every phase inherits it — no env-var plumbing needed.doctorwithrun.agent: "codex"→ both checks green (CLI + auth).sequant(2.15.1) resolves to/Users/tony/Projects/sequant/dist/bin/cli.js, i.e. the merged dev build, not a published tarball.~/.codex/config.tomlfor the main checkout and the bug(hooks): commit validator strips#from agit commit -F -heredoc subject, blocking everytype(#N):message sent via stdin #1064 worktree path (backup at~/.codex/config.toml.bak)..agents/skills -> ../.claude/skillsand.codex/config.toml(copied fromtemplates/codex/config.toml). Deliberately not viasequant init --agent codex—initCommandcallscreateDefaultSettings()unconditionally, which would overwrite.sequant/settings.jsonand wipe the tuned phase policy (spec=sonnet, exec=sonnet/medium, qa=opus, timeout 5400). Worth its own issue.Step 1 before launching — commit the provisioning
.agents/and.codex/are untracked. Worktrees are created frommain, so exec and qa would run without them and Codex would load no hooks — silently voiding G-5. From the main checkout:Then merge it (or run the gate on that branch). Nothing else blocks the launch.
Step 2 — launch
env -udrops the API key that is exported in your interactive shell, so the plan-auth path is unambiguous and the run cannot silently bill the API account instead. Expected branch/worktree:feature/1064-bug-hooks-commit-validator-strips-from-a-git-commi.Two things to expect: phases dispatched over MCP die at a hard 30-minute wall (this is a CLI run, so
run.timeout5400 applies instead), and the transcript JSONL lands under~/.codex/sessions/<date>/— that directory does not exist yet, so the newest file after the run is the one:Recording sheet
G-1 end-to-end. spec → exec → qa completes. Record wall time and
turn.completed.usagetotals from the JSONL. On plan auth there is no per-run dollar figure in a provider dashboard — record tokens and note the auth path instead of a $ number.G-2 skill-body fidelity. The yardstick is measured:
.claude/skills/qa/SKILL.mdis 176,271 bytes. Compare against what the transcript shows Codex actually read. Context: opencode truncated a skill body at ~51K of 175K, so a clamp here is a live possibility — if it clamps, does/qastill act on the deep sections (verdict-floor phrases, §6i mutation record)?G-3 harness-specific references. Pre-answered for free — 7 of 21 skills, matching the issue's count:
For this run only
execandqamatter. What remains for you: note whether each reference caused a stall or improvisation in the transcript, versus being read past harmlessly. That is the part the grep cannot answer.G-4
ghunder the sandbox. Didgh issue commentsucceed withnetwork_access = trueunder[sandbox_workspace_write], or did it needdanger-full-access?G-5 hook deny path. A deliberate
git push --forceinside a phase must exit 2 and be refused, visible in the JSONL. Requires step 1 — without the committed.codex/config.tomlin the worktree, the hooks never load and a pass here is meaningless.G-6 resume across phases. spec → exec in the same worktree should resume the thread (
canResumetrue); a forced cwd change must not.Verdict
Post GO/NO-GO here. GO files P2/P3 (Codex
[mcp_servers]forsequant serve;.codex/agentsor harness-neutral wording for the subagent-spawning skills; marketplace distribution). NO-GO records the blocking finding on #497 and parks it, with the driver staying shippable as experimental behind--agent codex.chore(#497): commit codex provisioning so worktree phases inherit ski…
admarble commentedon Sep 16, 2026
Gate run 1 — exec failed. Root cause: codex's
workspace-writesandbox cannot write a git worktree's indexenv -u CODEX_API_KEY sequant run 1064 --agent codex, 2026-09-16. spec 1:14 ✓ → exec 13:26 ✗ (exec left 5 file(s) uncommitted and made no commits). Log:run-2026-09-16T06-04-25-6dc90bb3-*.json. Transcript:~/.codex/sessions/2026/09/16/rollout-2026-09-16T01-06-04-01a0a8d2-*.jsonl.This is a harness incompatibility, not a model failure. Codex did the work correctly.
The finding
A git worktree keeps its metadata in the main repo:
.gitin the worktree is a pointer file readingworkspace-writemakes only the workspace (the worktree) writable, so every index write lands outside the sandbox. From the transcript, cell 25:Two fatals: one for
git add, one forgit commit. The agent saw them, tried again, and ended the phase with correct work it was structurally unable to commit. Sequant's #1032 guard then auto-committed it as8176c659.Reproduced deterministically at $0, no model call, using
codex sandbox:-c 'sandbox_workspace_write.writable_roots=["…/.git"]'did not help — the override appears not to reach thesandboxsubcommand, sowritable_rootsstill needs testing throughcodex execbefore being ruled out.What this means for the driver
CodexDriverdefaults toDEFAULT_SANDBOX_MODE = "workspace-write"(codex.ts:83), andrun.codex.sandboxModealready accepts"danger-full-access"(settings.ts:161). So the gate can be re-run today by setting:That trades away the sandbox entirely, which is a real cost: sequant's guard hooks were meant to be the safety net inside a sandbox, not instead of one. Worth resolving before any GO:
sandbox_workspace_write.writable_rootswork throughcodex exec? If the main repo's.gitcan be added,workspace-writesurvives and this becomes a driver default rather than a retreat.workspace-writeintact — a bigger change to sequant's isolation model, but it fits the sandbox rather than fighting it.Answers so far
codex login), as intended. Exec turn usage: 1,944,723 total tokens (1,844,480 cached input, 8,617 output). Rate-limit metadata in the transcript reports"plan_type": "free"andhas_credits: false— worth checking against what you expect to be billed..claude/skills/exec/SKILL.mdin six sequential chunks (sed -n '1,240p','241,520p', …'1901,2300p') and acted on it. That is a genuine signal for G-2: no clamp, and the skill body was consumed in full, by paging rather than one read.Not the cause (checked)
fnmnoise on every command (error: Can't create the symlink for multishells …) is harmless:npm run lintcompletes normally under the same sandbox.pre-tool.shdid not block the commit — fed the exact command it ran, the hook exits 0 in 0.13s.exec/waitpair returned every command's output, including both fatals.admarble commentedon Sep 16, 2026
Correction to the run-1 analysis — the cause is narrower, and the fix is a one-liner
Two errors in my previous comment, both from trusting
codex sandboxas a $0 oracle without checking its defaults.1.
codex sandboxdefaults to read-only, notworkspace-write. So the "reproduction" I reported was a read-only denial, where everything fails — it did not reproduce the exec policy. Re-tested with-c 'sandbox_mode="workspace-write"', which is what the driver actually passes.2. The cause is not "the worktree's git dir lives outside the workspace." Under
workspace-write, codex makes the workspace writable but excludes.git/:That is a deliberate protection, and it means no git repo can be committed to under
workspace-write— worktree or not. I verified a plaingit clone, with its.gitdirectly inside the workspace, fails identically. So "use a clone instead of a worktree", which I floated as remedy 2, does not help at all.Verified matrix (all $0, no model calls)
sandbox_modeworkspace-writefatal: Unable to create '…/index.lock'.gitinside the workspaceworkspace-writeworkspace-writewritable_roots=["<main>/.git"]workspace-writedanger-full-accessThe fix
writable_rootsworks, contrary to what I reported — my earlier attempts failed becausecodex sandboxignores the flag while defaulting to read-only, not because the key is unsupported. Passing the repo's git dir as a writable root keeps the sandbox intact and needs no settings change from users:CodexDrivercan derive that per run (git rev-parse --git-common-dir, which resolves to the main.gitfor a worktree) and pass it wheneversandboxModeisworkspace-write.danger-full-accessstops being necessary, which matters: the guard hooks were designed to run inside a sandbox, not instead of one.This is a blocking defect in the driver — without it, every codex phase ends unable to commit — so it should be fixed and the gate re-run before any GO/NO-GO judgment. The G-2 signal from run 1 still stands: exec read the full
exec/SKILL.mdin six sequential chunks with no clamp.fix(#1076): pass the git dir as a codex writable root so phases can c…
fix(#1079): enable network access for codex workspace-write phases (#…
admarble commentedon Sep 18, 2026
Gate runs 2 + 3 — record (verdict left to the owner)
Run 2 —
env -u CODEX_API_KEY sequant run 1064 --agent codex, 2026-09-18 12:31Z. spec ✓ 146s → testgen ✓ 96s → exec ✗ 349s:codex turn failed: You've hit your usage limit … try again at Oct 16th. The ChatGPT account is on the free plan (plan_type: "free", 30-day window); run 1 had already spent part of it and spec left it at 52%. Exec committed819d30c0itself before the limit hit.Run 3 —
sequant run 1064 --agent codex --phases exec,qawithCODEX_API_KEYexported (API billing; the transcripts carry no plan rate-limits, confirming the key was used). Modelgpt-6-astra. exec ✓ 1,353s → qa ✗ 735s, AC_NOT_MET.Logs:
run-2026-09-18T12-31-04-2ea6990e-*.json,run-2026-09-18T13-28-01-357f0888-*.json. Transcripts:~/.codex/sessions/2026/09/18/rollout-2026-09-18T07-3*(run 2),rollout-2026-09-18T08-*(run 3).What QA said
AC-1…AC-5 MET (351/351 hook tests, build, three identical mirrors); no implementation defect found. AC-6 NOT_MET plus missing AC-1/AC-2 mutation records — both because no PR exists to hold them. Exec declined to open one because its broad verification did not pass (see "Exec's red suite" below). The verdict is correct for the state it was given, and the report is thorough and honest: it ran independent mutation smoke checks, labelled them supplemental rather than a substitute for the required record, and emitted a structured
SEQUANT_QA_GAPSmarker.Gate answers
exec, but the free tier cannot carry one full run.catof a skill is clamped atmax_output_tokens: 12000(qa/SKILL.mdis 176,271 bytes / 3,754 lines). The agent then builds a heading index (rg -n '^#{1,4} ') and reads deep sections by line range — Small-Diff Fast Path (l.1126), §6j (l.2554), §7 verdict (l.2597+), §8 (l.2904) — and demonstrably acts on them. Run 2 instead pagedexec/SKILL.mdin 7 sequentialsedchunks. No section went unread for lack of access.Agent(subagent_typemaps onto Codex's native subagents: qa spawnedtype_checks,scope_checks,security_checks; testgen spawnedparse_criteria. No stall or improvisation traced toTask(/AskUserQuestion/nestedSkill(in exec or qa. List of skills needing harness-neutral wording: none required by this run.ghunder the sandboxnetwork_access = trueunderworkspace-writesuffices —gh issue viewandgh issue commentworked (spec + testgen comments on #1064).danger-full-accessnot needed.[projects."<worktree>"]entry pre-existed. Open question stands.Exec's red suite — not the sandbox
Exec reported 7 failures in files the diff never touched and timed out lint/build. I first read this as sandbox damage; that was wrong. Measured at $0:
codex sandboxwith the driver's exactworkspace-write+writable_roots+network_accessconfig: 76/76 pass.phase-executor.ts:1458): 2 fail —prompt-wait.test.tsbreaks onSEQUANT_ORCHESTRATOR=sequant-run,batch-executor.test.ts("returns the input config unchanged when onProgress is undefined") onSEQUANT_WORKTREE. The suite is not hermetic against the env its own phases run under; this is driver-agnostic.cli-uiminimal-mode, 3 slowbatch-executorcases at 7–10s) did not reproduce in isolation; exec had several vitest runs plus lint in flight concurrently, which fits the timeouts. Unexplained, not attributed.Other finding
Run 2's usage-limit failure was classified
category: "unknown",isRetryable: false— the driver wraps anyturn.failedas a genericSequantError(codex.ts:323), so the orchestrator cannot tell quota exhaustion from a code failure, and the spec-requested quality loop ran straight into the same limit 4.7s later.Recommendation
Every harness mechanic the gate asked about works, and skill fidelity is good — QA under Codex caught exactly what it should. Nothing observed is a Codex-caused NO-GO. The one thing that kept G-1 from a clean pass is sequant-side (non-hermetic tests). My read is GO, driver stays experimental until a clean end-to-end run produces a PR — but the verdict is yours.
Follow-ups filed and #1064's PR: see the next comment.
admarble commentedon Sep 18, 2026
Follow-ups from the run 2 + 3 record above:
SEQUANT_*env phases inject (the driver-agnostic cause of exec's red suite in run 3).turn.failedclassifiedunknown; quality loop re-runs into the quota.#from agit commit -F -heredoc subject, blocking everytype(#N):message sent via stdin #1064: Codex's819d30c0plus the evidence QA found missing. Mutation records re-run independently (each mutation fails exactly its targeted test), and AC-6 settled experimentally: a Claude Code session runs both the repo and the plugin-cachepre-tool.shon every tool call, so the fix reaches users only once the plugin cache carries it.G-1 remains open: no run has yet gone spec → exec → qa → PR unaided. #1086 is the blocker for that; the GO/NO-GO verdict is still the owner's.
chore(hooks): allow anchored env|grep in the env-dump guard; red test…
admarble commentedon Oct 17, 2026
Checklist line for this gate (from graph-2026-10-freeze-c planning, #1492; not a graph node):
codex execreads the user's~/.codex/config.toml, so anmcp_serversentry there reaches phase agents, as claude.ai connectors did before fix(mcp): phase agents receive the user's claude.ai connectors (Gmail, Docs) outside the #936 allowlist #1396. Isolate it the way the opencode driver does with a per-runXDG_CONFIG_HOME(src/lib/workflow/drivers/opencode.ts:677-685), or record here why the gate accepts it.