Repository navigation
Description
Problem
The managed worktree itself is writable, but its .git file points to linked
worktree metadata beneath the primary checkout:
cwd:
/Users/willem/Library/Application Support/Solenta/worktrees/15ff9829-4446-44ad-92a2-c4e14e991e05
.git:
gitdir: /Users/willem/code/coder/.git/worktrees/15ff9829-4446-44ad-92a2-c4e14e991e05
git rev-parse --git-common-dir:
/Users/willem/code/coder/.git
The sandbox grants write access to the visible worktree but only read access to
its .git entry. Git needs narrow write access to the resolved gitdir and
common object/ref storage.
Attempting to commit the approved design specification failed at the first
write:
fatal: Unable to create
'/Users/willem/code/coder/.git/worktrees/15ff9829-4446-44ad-92a2-c4e14e991e05/index.lock':
Operation not permitted
Solenta later created an automatic coder-checkpoint outside the agent
sandbox. That preserves the diff, but it does not satisfy workflows that
require the agent to make a named commit, hand a commit to another worker, or
finish a branch deliberately.
Impact
- Agents can edit code but cannot stage or commit it.
- Skills that require a design/spec commit cannot complete their workflow.
- Worker-to-worker handoffs using
git show <branch>:<path>are blocked. - Normal branch completion, merge preparation, and commit verification cannot
be performed by the session that authored the change. - The error appears late, after useful work has already been produced.
Expected behavior
A managed worktree must support ordinary Git operations for its own branch
without granting write access to another worktree or to unrelated files in the
primary checkout.
Suggested fix direction
- Resolve the worktree's
gitdirandgit-common-dirbefore constructing the
sandbox profile. - Grant the minimum Git write paths needed for this worktree's index, locks,
refs/logs, and object creation. - Prefer a narrow Git-operation broker if granting common object-store access
directly would make the sandbox boundary too broad. - Preflight the permission during session startup and report a named degraded
mode before edits begin.
Acceptance criteria
- Start an agent in a Solenta-managed linked worktree.
- Create one file, then run
git add,git commit, andgit statusfrom the
agent session. - The commit succeeds and the worktree becomes clean.
- The agent can read its resulting commit with
git show. - The sandbox still prevents mutation of another worktree's index, HEAD, and
worktree-specific refs. - An integration test uses a real linked-worktree
.gitpointer; testing only
a standalone repository is insufficient.
Found while planning live speech-to-text in thread 15ff9829-4446-44ad-92a2-c4e14e991e05 on 2026-09-03. Draft: docs/issue-drafts/2026-09-03-solenta-session-blockers.md.
Activity
currentbits commentedon Sep 3, 2026
Implemented on this branch: for Codex
workspace-write, Solenta now passes extrasandbox_workspace_write.writable_rootsfor a linked worktree:<main>/.git/worktrees/<id>) soindex.lockworksobjects,refs, andlogssogit commitcan write the object and the branchThe whole common dir is not granted, so a sibling worktree's index/HEAD stay outside the sandbox. Standalone checkouts (
.gitinside cwd) get no extra roots.See
electron/codexWorkspaceWrite.js, wired fromrunner.jsandworkflow.js.currentbits commentedon Sep 6, 2026
Landed. Codex workspace-write now passes sandbox_workspace_write.writable_roots for a linked worktree gitdir plus shared objects/refs/logs (not the whole common dir, not sibling worktrees). Standalone .git-in-cwd needs nothing extra. Independent of the #848 GitHub proxy.
Source was checkpoint 24745755 on coder/users-willem-library-application-support-b73e11, which never reached origin/main; the later #848 GitHub-proxy rewrite kept only network_access. Restored onto that helper in 118418c6. runner.js and workflow.js pass cwd. Regression: electron/test/codex-workspace-write.test.js and the runner case in electron/test/codex.test.js.