You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(drivers): codex conformance commit item fails locally on macOS — git add exits 128 inside the sandbox #1480
src/lib/workflow/drivers/__tests__/driver-conformance.test.ts > driver conformance > codex > commit: git add and git commit succeed inside the driver's default sandbox fails locally on macOS: git add conformance.txt exits 128 inside the codex sandbox (expected 0, line 902).
It is red at origin/main too, so no branch caused it:
Ref
Result
Head
feature/1454-… @ f9c40d8d7
FAIL (exit 1)
Base
origin/main @ 9f1fb3fdc
FAIL (exit 1)
It still fails with every SEQUANT_* var unset, so this is not #1086. Found by scripts/settle-against-base.sh during the #1454 exec phase (2026-10-16).
Likely cause (not verified)
The test runs only where a codex binary is installed, so CI may never run it. Exit 128 from git add inside a seatbelt sandbox usually means git could not write .git/index.lock or read a path outside the sandbox's writable roots (for example a gitdir or a global config outside the worktree).
Acceptance Criteria
AC-1: The codex commit item passes on a macOS machine with codex installed, or it skips with a named reason when the sandbox cannot run there. Evidence: npx vitest run src/lib/workflow/drivers/__tests__/driver-conformance.test.ts -t "git add and git commit succeed" on such a machine.
Root cause verified 2026-10-18 on codex-cli 0.154.0, macOS. This is a driver bug, not a test bug: the test is doing its job.
What fails. From a linked worktree, git add and git commit inside the sandbox die with fatal: Unable to create '<repo>/.git/worktrees/<wt>/index.lock': Operation not permitted (exit 128). Reproduced with GIT_CONFIG_GLOBAL=/dev/null, so commit signing is not involved.
Why. The driver passes one writable root: git rev-parse --git-common-dir (<repo>/.git, the #1076 fix). codex's workspace-write policy marks <writable_root>/.git read-only and, when the cwd's .git is a gitdir: pointer file, also marks the resolved directory read-only (default_read_only_subpaths_for_writable_root, see openai/codex#27418). For a worktree that resolved directory is <repo>/.git/worktrees/<wt>, where the index, HEAD and COMMIT_EDITMSG live. A deny on a subpath beats the allow on its parent, so granting <repo>/.git is not enough.
Probes (same permission profile the conformance test writes, touch under each path):
cwd
writable roots
target
result
worktree
wt, <repo>/.git
<repo>/.git/probe
writable
worktree
wt, <repo>/.git
<repo>/.git/objects/probe
writable
worktree
wt, <repo>/.git
<repo>/.git/worktrees/<wt>/probe
denied
worktree
wt, <repo>/.git, <repo>/.git/worktrees/<wt>
<repo>/.git/worktrees/<wt>/probe
writable
main checkout
repo, <repo>/.git
<repo>/.git/probe
writable
Fix.buildCodexArgs adds git rev-parse --git-dir (resolved to an absolute path) as a second writable root whenever it differs from the common dir. Plain clones are unchanged (both resolve to .git). Every sequant phase runs in a worktree, so today the codex driver cannot commit in any real run — the #1076 class, worktree variant.
Caveat. Verified through codex sandbox --permission-profile (the test's translation of the exec flags); codex exec -s workspace-write shares the policy builder but was not run here (API cost). The conformance item is skipped in CI because codex is not on PATH there, so this only shows on a developer machine.
Suggested reshaping of the issue: title fix(codex): workspace-write denies the worktree gitdir — add --git-dir to writable_roots so phases can commit from a worktree; AC-1 a unit test on buildCodexArgs against a real temp repo + worktree asserting both roots are present and a plain clone yields one; AC-2 the existing conformance item passing on a codex machine (runner evidence, since CI skips it).
Activity
admarble commentedon Oct 18, 2026
Root cause verified 2026-10-18 on codex-cli 0.154.0, macOS. This is a driver bug, not a test bug: the test is doing its job.
What fails. From a linked worktree,
git addandgit commitinside the sandbox die withfatal: Unable to create '<repo>/.git/worktrees/<wt>/index.lock': Operation not permitted(exit 128). Reproduced withGIT_CONFIG_GLOBAL=/dev/null, so commit signing is not involved.Why. The driver passes one writable root:
git rev-parse --git-common-dir(<repo>/.git, the #1076 fix). codex's workspace-write policy marks<writable_root>/.gitread-only and, when the cwd's.gitis agitdir:pointer file, also marks the resolved directory read-only (default_read_only_subpaths_for_writable_root, see openai/codex#27418). For a worktree that resolved directory is<repo>/.git/worktrees/<wt>, where the index,HEADandCOMMIT_EDITMSGlive. A deny on a subpath beats the allow on its parent, so granting<repo>/.gitis not enough.Probes (same permission profile the conformance test writes,
touchunder each path):<repo>/.git<repo>/.git/probe<repo>/.git<repo>/.git/objects/probe<repo>/.git<repo>/.git/worktrees/<wt>/probe<repo>/.git,<repo>/.git/worktrees/<wt><repo>/.git/worktrees/<wt>/probe<repo>/.git<repo>/.git/probeFix.
buildCodexArgsaddsgit rev-parse --git-dir(resolved to an absolute path) as a second writable root whenever it differs from the common dir. Plain clones are unchanged (both resolve to.git). Every sequant phase runs in a worktree, so today the codex driver cannot commit in any real run — the #1076 class, worktree variant.Caveat. Verified through
codex sandbox --permission-profile(the test's translation of the exec flags);codex exec -s workspace-writeshares the policy builder but was not run here (API cost). The conformance item is skipped in CI becausecodexis not on PATH there, so this only shows on a developer machine.Suggested reshaping of the issue: title
fix(codex): workspace-write denies the worktree gitdir — add --git-dir to writable_roots so phases can commit from a worktree; AC-1 a unit test onbuildCodexArgsagainst a real temp repo + worktree asserting both roots are present and a plain clone yields one; AC-2 the existing conformance item passing on a codex machine (runner evidence, since CI skips it).