Repository navigation
Description
Live incident (2026-09-09)
Codex thread 37c370d1-024b-4ca7-812e-24beabfe17e5 (GPT-6 Astra) implemented #935 (failed thread-notes saves discard the typed draft). Worker 9c1d4991-c4c9-473b-94ba-0119bbbf7610 finished on branch coder/fork-failed-thread-notes-saves-discard-t-9c1d49 at 3b54764e. The user approved thread_merge.
Two Codex sandbox / landing failures then happened in the same run. This is a live miss of closed #847, not a new product area.
1. git add / git commit still fail under workspace-write
After the merge landed in the wrong tree (below), Codex applied the notes-save patch in the session checkout, ran the eight notes tests plus typecheck, and then could not commit:
These local changes remain uncommitted because the sandbox blocks Git index writes.
That is the same linked-worktree failure #847 already described. A Solenta managed worktree's .git file points outside cwd:
cwd:
/Users/willem/Library/Application Support/Solenta/worktrees/<threadId>
.git:
gitdir: /Users/willem/code/coder/.git/worktrees/<threadId>
git rev-parse --git-common-dir:
/Users/willem/code/coder/.git
codex exec --sandbox workspace-write only allows writes in cwd. git add / git commit need to create index.lock in the resolved gitdir, which is under the host repo. Historical error from the original #847 draft:
fatal: Unable to create
'/Users/willem/code/coder/.git/worktrees/<id>/index.lock':
Operation not permitted
#847 is plan:done. electron/codexWorkspaceWrite.js emits sandbox_workspace_write.writable_roots for that gitdir plus shared objects / refs / logs, and electron/test/codex.test.js asserts the flag is on the argv. A live Codex session on 2026-09-09 still could not write the index.
Likely remaining holes (do not assume which without a repro):
- The running app never passed
writable_roots(cwd used for the flag was the project checkout, not the linked worktree). - The flag is present but Codex still denies
index.lock(seatbelt / TOML quoting / incomplete roots). - Permission mode mapped to
read-only(plan) socodexWorkspaceWriteArgsreturned[].
2. Same session: thread_merge committed onto coder-release-build main
Codex reported:
The merge tool landed
be1b6006onmainincoder-release-build, rather than the current branch.
Confirmed on disk after the run:
| checkout | HEAD | branch |
|---|---|---|
~/code/coder-release-build |
be1b6006 |
main |
~/code/coder |
9fc8645a |
coder/notes-save-reject-935 |
| Solenta worktree for this follow-up thread | b1b499b9 |
coder/fork-failed-thread-notes-saves-discard-t-03fc27 |
thread_merge is supposed to land on the lead's worktree branch, or on the project checkout's current branch only when the lead has no managed worktree (electron/orchServer.js: intoPath = self.worktreePath || projectOf(self)?.path). Landing on ~/code/coder-release-build main means the merge destination was the configured project checkout, not the session the user was looking at.
This is the same class of cwd / worktreePath mismatch that would also skip writable_roots (those roots are computed from thread.worktreePath || project.path). Related history: #614 (workers landing onto main with no user say, already gated), #786 (stale coder-release-build main).
Current orchServer.js requires expectedPath + expectedBranch and refuses a mismatch. The live merge still wrote be1b6006 onto that main, so either the running build did not yet enforce those fields, or Codex passed the project checkout / main as the approved destination while its own cwd was elsewhere.
Impact
- Codex can edit files in a managed worktree and cannot stage or commit them.
- An approved worker merge can commit onto a different checkout than the thread the user is in (
coder-release-buildmainvs the session branch). - Follow-up agents then see uncommitted patches, coder-checkpoints, and a
plan:doneissue (Failed thread-notes saves discard the edited text when the editor is reopened #935) whose fix is not onorigin/main(see PR fix: keep failed thread-notes drafts and retry on save reject (#935) #1159).
Expected
- In a Solenta-managed linked worktree, Codex
workspace-writecangit add,git commit, andgit statusuntil clean. writable_rootsis computed from the same cwd Codex exec actually uses, includingApplication Support/Solenta/worktrees/<threadId>.thread_mergelands on that session's worktree and current branch, or refuses, and never silently commits onto~/code/coder-release-buildmain.- A regression test actually runs
git commitinside the sandbox (argv inspection forwritable_rootswas not enough).
Related
- Managed worktrees cannot run
git addorgit commitbecause their Git metadata is read-only #847 (closed) Managed worktrees cannotgit add/git commitbecause Git metadata is read-only - Codex threads run in a read-only sandbox; Solenta never passes --sandbox #170 (closed) Codex threads run in a read-only sandbox; Solenta never passes
--sandbox - Planboard requires
gh, but managed sessions cannot authenticate or reach GitHub #848 / Codex sessions advertise Planboard MCP writes but omit issue tools and reject authorized GitHub writes #927 Codex GitHub / Planboard writes inside the same sandbox - Workers land themselves: thread_merge commits worker branches onto main with no user say #614 / Reset stale release-build main #786 merge landing onto project
main/ stalecoder-release-build - Failed thread-notes saves discard the edited text when the editor is reopened #935 notes-save retry (the work that hit this)
Activity
currentbits commentedon Sep 9, 2026
Fixed on coder/fork-failed-thread-notes-saves-discard-t-03fc27 at 07aab234.
Codex workspace-write carves
.git/gitdir:out as read-only under cwd.codexWorkspaceWritableRootsnow always grants this checkout's gitdir (standalone included) plus linked-worktree objects/refs/logs. Livecodex sandboxtest outside /tmp: git add fails without those roots, git add+commit succeed with them (macOS Codex 0.153.4).thread_mergedestination mismatch (expectedPath/expectedBranch) was already in this tree; orch-merge tests still pass. packed-refs.lock in the common dir root still EPERM; commit succeeds via loose refs.