Skip to content

Auto-discovered gitignored vendor repos break worktree creation when a checkout hook links them (path_already_exists) #40406

Closed

Description

@dawsonpvosburg-cmyk

What happened

After updating to today's nightly, every new worker/subagent thread in my main project fails to start. T3 now auto-detects six gitignored vendored checkouts under vendor/ (accesskit, docling, gpui-kit, gpui-storybook, hayagriva, zed) as tracked folders of the project. When it provisions a worktree for a new worker, it tries to make a git worktree of each one, fails on the first (accesskit), and the worker never starts.

Diagnosis

This comes from the multi-repository project work in #35925 (commit 60863edc, merged 2026-11-21).

  1. discoverFolders (apps/server/src/workspace/WorkspaceFolders.ts) scans the project folder and treats every nested folder with its own .git as a project repository. Submodules are skipped, but gitignored, independently cloned checkouts are not. Here these are vendored third-party checkouts that a setup script clones, and the project does not track them.
  2. TaskFolders.create first runs git worktree add for the project repository. That fires the project's post-checkout hook, which (like many repos with vendored checkouts) symlinks each vendor/<name> in the new worktree back to the main checkout, so builds in the worktree can find them.
  3. createRepositoryWorktree then runs git worktree add in vendor/accesskit, targeting the same relative path inside the new worktree. A symlink is already there, so git fails with path_already_exists. Repositories at each level run to completion, the first failure fails the whole TaskFolders.create, and the thread launch fails at provision-worktree.

Rollback works: no stray t3/* branches or worktrees are left in the vendor repos. However, deleteLocalBranch also logs a failure during rollback, because the branch was never created.

The problem is that a project that worked yesterday breaks with no change on its side, and the error does not point at the new discovery or at ignoreRepositories. Possible directions:

  • Skip discovered repositories that .gitignore ignores in the parent repository (the parent clearly does not version them), or make discovery of those opt-in.
  • When the mapped path already exists after the parent worktree is created (e.g. a hook or setup script put a symlink or checkout there), adopt or skip it instead of failing the launch, similar to how submodules are treated as owned by the parent.
  • At minimum, have the error name the repository as auto-discovered and suggest ignoreRepositories in t3.json.

Steps to reproduce

  1. Make a git repo app with vendor/lib/ listed in .gitignore.
  2. Clone any repo into app/vendor/lib (an independent nested repo, not a submodule).
  3. Add a post-checkout hook to app (via core.hooksPath) that, inside a linked worktree, runs ln -s "<main checkout>/vendor/lib" vendor/lib.
  4. Add app as a project in T3 Code (nightly 0.1.12-nightly.20261121.5051) and start a new thread in "New worktree" mode, or have an agent delegate a task to a worker.
  5. Launch fails: TaskFolderError: Could not create the lib worktree: git worktree add failed, caused by path_already_exists.

Without step 3, I expect a fresh worktree of the vendored repo to be created, which also seems unwanted for gitignored vendored checkouts (and is expensive for something like zed).

Version

T3 Code (Nightly) desktop app, 0.1.12-nightly.20261121.5051 (local server reports the same version). It worked on the previous nightly.

Environment

  • macOS (darwin arm64, 27.2.0)
  • Node v24.22.1
  • git 2.56.1
  • Surface: desktop app against its local server

Evidence

Server trace (server.trace.ndjson), redacted:

TaskFolders.create  Failure
TaskFolderError: Could not create the accesskit worktree: git worktree add failed
  [cause]: GitCommandError: Git command failed in GitVcsDriver.createWorktree (~/dev/meaning-native/vendor/accesskit): git worktree add failed (path_already_exists)

ThreadLaunchService.prepareInBackground  Failure
ThreadLaunchError: Thread launch command:mcp:…:delegate-task:… failed during provision-worktree.

GitWorkflowService.deleteLocalBranch  Failure   (during rollback)
GitCommandError: Git command failed in GitVcsDriver.deleteLocalBranch (~/dev/meaning-native/vendor/accesskit): git branch delete failed

The newest worker worktree shows the hook-made symlink at the target path:

<worktree>/vendor/accesskit -> ~/dev/meaning-native/vendor/accesskit

Related issues

Fix applied or workaround

Added a t3.json at the project root listing all six checkouts under ignoreRepositories:

{ "ignoreRepositories": ["vendor/accesskit", "vendor/docling", "vendor/gpui-kit", "vendor/gpui-storybook", "vendor/hayagriva", "vendor/zed"] }

Filed by

Claude Code (Claude Opus 5.5, claude-opus-5-5) via t3 triage.

Activity

  1. dawsonpvosburg-cmyk commented on Nov 21, 2026

    @dawsonpvosburg-cmyk
    Author

    Confirmed: the ignoreRepositories workaround in t3.json works. With the six vendored checkouts listed, new worker threads launch again on 0.1.12-nightly.20261121.5051, with no restart needed. The project worktree is created and the post-checkout hook links vendor/* as before.

    Added by Claude Code (Claude Opus 5.5) via t3 triage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions