[Bug]: Externally created Git worktrees are treated as “Local”
Before submitting
- [x] I searched existing issues and did not find a duplicate.
- [x] I included enough detail to reproduce or investigate the problem.
Area
apps/desktop
Steps to reproduce
-
create a new thread;
-
ask the model to create a new worktree (or have it on AGENTS.md as steps to start a new task like I do)
-
check T3 Code indicator pointing as "local"
-
check the "Open button" loading the original repo folder, instead of the worktree.
Expected behavior
The worktree should be recognized as a Worktree, regardless of how it was created
Actual behavior
T3 Code does not recognize the new Worktree and it thinks it's on the original repo folder.
Impact
Minor bug or occasional failure
Version or commit
No response
Environment
No response
Logs or stack traces
Screenshots, recordings, or supporting files
Workaround
No response
I encontered this too. In the session I pointed it to the correct directory, and I hope it will go well from there.
+1, this also breaks trust in the footer indicator more generally. Concrete case: the agent created a worktree + branch feat/age-permis-conditions from origin/dev mid-thread, and the composer footer still shows "Local checkout · dev" for the rest of the conversation. As a user I can never tell with certainty which branch/worktree the thread is actually operating on — the indicator looks authoritative but reflects the initial binding, not reality. Looking forward to #3754.
Tested on 1dfb572871 with git worktree add. Selecting the external worktree started the agent there, and t3_worktree_list returned its correct path. Creating a worktree alone kept the existing thread at its original directory, matching pwd. Which provider and commands moved your session into the worktree, and does this still occur on the latest version?
Thanks for testing, your result matches mine. Re-tested today on 0.0.46-nightly.20261021.3457 with Claude (Opus 5.5):
git worktree add -b repro-a ../repro-a-wt HEAD+cd ../repro-a-wt:t3_worktree_statusreturnsattached: false, and the next shell command is back at the project root. So in my original case the agent was working in the worktree viacd/absolute paths while the thread stayed bound to the root checkout. The footer was technically right; that part isn't a bug.- The supported path,
t3_worktree_handoffwith acontinuationPrompt, does rebind the thread, but the Claude turn then fails with "The provider event stream closed unexpectedly", the continuation stays Queued, and "Waiting on background task mcp__t3-code__t3_worktree_handoff" can't be stopped. That's #15136 / #15993 (fix in #15203, still open).
So with Claude there's currently no working way for an agent to move its own thread into a worktree, which is why agents fall back to git worktree add + cd and end up in the #1714 situation. From my side this can be closed in favor of #15136.
[!NOTE] 🤖 Claude Opus 5.5 responding on behalf of Theo
Thanks for the report. Issue #15136 already tracks this problem, so we close this issue to keep all detail in one place. Please follow #15136 and add your version and steps there if they differ. Please do not open a new issue for the same problem.