Skip to content

fix(server): let delegated worktrees commit through T3 - #6

Merged
royalaid merged 7 commits into
mainfrom
fix/codex-worktree-git-roots
Oct 29, 2026
Merged

royalaid merged 7 commits into
mainfrom
fix/codex-worktree-git-roots

Conversation

@royalaid

@royalaid royalaid commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Codex children in linked worktrees cannot commit because Git metadata is outside their sandbox. Add t3_worktree_commit so a delegate_task child can ask T3 to commit on its assigned branch without widening Codex's sandbox.

T3 reserves t3/<SHA-256 of child thread ID>/work and records the worktree, admin directory, common directory and branch before setup starts. Only authenticated children with that record see the tool. Each commit validates the metadata and HEAD, uses explicit Git directories, disables callbacks, and updates only the recorded child ref with a no-deref compare-and-swap. It never pushes.

Git is resolved at service construction from absolute PATH entries only. Both the commit broker and VcsProcess spawn that absolute executable, avoiding executable lookup in the child checkout. Paths using configured filters, including Git LFS, are refused before staging rather than committed as raw content. Commits include a T3-Delegate-Thread trailer.

Failed child setup removes the worktree, only its reserved branch, and its authority record so preparation can be retried. Thread deletion also queues authority cleanup. Direct non-delegate commit calls return capability_denied.

Validation: 162 focused tests pass across eight suites on Linux with Git 2.53.0, including absolute executable selection/spawns, failed-setup retry, filter refusal without staging, cleanup effects, trailers and direct-call denial. Server and shared package typechecks exit 0. Scoped lint passes with two existing warnings. The withdrawn writable-roots helper and Codex adapter changes remain removed.

Windows/macOS native runs and packaged application builds were not done. No merge, release or installation has occurred. Opus approved 7460dd3 after re-review. The two approved final Lows are included: clean-filter suppression has a mutation-checked regression test, and stage-all filter refusals suggest explicit paths. Royal authorized merging these small changes without another review round.

Upstream issue: pingdotgg#26865

Non-blocking notes retained from review: worktree-add can create a branch and fail before the cleanup path captures it; Git executable resolution is pinned until the server restarts.

Reviewed with sol-loop: Opus approved the broker and all six requested fixes; the final two small Lows were authorized without another round.

Created with GPT-6.1 Sol in the Codex harness.

@royalaid

Copy link
Copy Markdown
Collaborator Author

Opus review of fc23fe2: CHANGES REQUESTED. This approach is withdrawn. Do not merge or release it.

  • Critical: making .git/worktrees/<name> writable defeats Codex's deliberate Git metadata read-only carve-out. The child can alter commondir or config.worktree, affecting configuration used by a later unsandboxed Git operation. workspaceWrite provides no read-only carve-out field to narrow this grant safely.
  • High: shared refs/ and logs/refs write access allows changing main and other branches.
  • Medium: shared objects/ write access allows deleting packs.

The earlier claim that the grants exclude config/hooks is insufficient and withdrawn: writable per-worktree metadata can redirect Git configuration. Passing tests do not establish this approach is safe. Converted to draft; no merge or rollout. The bosun report remains open and the replacement approach goes back to Royal.

@royalaid royalaid changed the title fix(server): allow Codex commits in linked worktree sandboxes fix(server): let delegated worktrees commit through T3 Oct 29, 2026
@royalaid
royalaid marked this pull request as ready for review October 29, 2026 09:18
@royalaid
royalaid merged commit 759c0f1 into main Oct 29, 2026
@royalaid
royalaid deleted the fix/codex-worktree-git-roots branch October 29, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant