Repository navigation
Description
What happened
I asked the agent to check out the PR branch in the main project folder so I could inspect the diff. The agent moved the uncommitted changes there and removed the temporary worktree. The changes were still present in the main checkout, but every subsequent message in the original thread failed before the agent started. I expected to be able to point the same thread at the new checkout without losing its history.
Diagnosis
Before the checkout, the thread was bound to a manually created worktree outside T3's managed worktree directory. Removing it with Git did not update the saved worktreePath. In v0.1.10, restoreMissingWorktree skips unmanaged paths, and ProviderSessionManager.open rejects the missing working directory. A recovery action to select an existing checkout, including the project root, would let users keep the same thread without silently running it in a different directory.
Steps to reproduce
- In a disposable repo, start a project thread. Create a linked Git worktree outside T3's managed worktrees directory, with its own local branch.
- Select that branch in T3 and verify the thread is bound to the external worktree.
- When the thread is idle and that worktree is clean, run
git -C <external-worktree> switch --detach, check out the same branch in the main project checkout, then rungit -C <project-root> worktree remove <external-worktree>. - Send another message in the same thread. It still points to the old path and fails before the provider starts.
These steps are reduced from the observed incident and source; they were not replayed in a fresh install.
Version
T3 Code server 0.1.10 (confirmed). Desktop 0.1.10 is the client that initiated triage.
Environment
Windows desktop; local Linux x64 server under WSL2; Claude provider; Git 2.56.1; Node v26.13.1 in triage diagnostics.
Evidence
05:30:12 UTC thread.metadata-updated: worktreePath = <external-worktree>
05:30:52 UTC git worktree remove completed; the branch and local changes were in the main checkout
05:32:06 UTC ProviderWorkspaceMissingError: This thread's workspace folder no longer exists or is not a directory: <external-worktree>. Restore the folder at this path before retrying.
05:32:15 UTC Retrying a simple message fails with the same error.Related issues
#29062 covers the incorrect Initialize Git action after removal of a managed worktree. #36415 covers a PR branch that remains checked out in a worktree. Neither covers rebinding a thread after its external worktree has been removed.
Fix applied or workaround
Not applied. Recreate a detached Git worktree at the original path long enough to make the branch picker available. Select the branch already checked out in the project root and verify the thread's workspace before removing the temporary worktree. The uncommitted changes can stay in the main checkout.
Filed by
OpenCode (lab/gpt-6.2-sol), via T3 triage
Activity
paveltar commentedon Nov 20, 2026
Same failure on macOS, with a few details that widen the scope.
Environment: macOS 27.2 (arm64), T3 Code Desktop 0.1.10 with its local 0.1.10 server, Claude provider (claude-opus-5-5).
What happened: The thread was bound to a Git worktree that Claude Code created (
<repo>/.claude/worktrees/dev), outside T3's managed worktrees directory. I asked the agent to delete the worktree, check out the branch in the main checkout, and move the thread there. It removed the worktree and checked out the branch, then reported that it could not rebind the thread: "T3 still lists it as attached to the deleted worktree path, and none of my tools can change a thread's folder." The next message failed 1.5 s after it was sent, before the provider started:Additional findings
lineage.sideChat: true,forkedFrom.type: run) got the sameworktreePathand its first message ("test") failed with the same error. So a fork is not a way out either.worktreePath = <repo>/.claude/worktrees/dev.cwdset to the thread's worktree path, and the server trace showsGitCommandError: ... headPath (<repo>/.claude/worktrees/dev): Failed to spawn Git process.The environment mode selector is locked once a thread has messages, so there is no UI path back to the project root.t3_worktree_handoffonly moves a thread into a new managed worktree. No MCP tool can set a thread's folder to the project root or an existing checkout (as [Bug]: Agents can't move a thread out of its workspace before deleting it, so the thread becomes unusable #36151 described before it was closed as a feature request).Timeline (UTC, 2026-11-19)
Workaround confirmed from source (v0.1.10):
resolveBranchSelectionTargetsetsnextWorktreePathtonullwhen the picked branch is checked out in the project's own checkout. So: recreate a throwaway worktree at the old path (git worktree add --detach <old-path>) so the picker can list refs, pick the branch checked out in the main checkout, then remove the temporary worktree.Suggestion: besides a "Move to project root" recovery action on the error, it would help if
t3_worktree_statusor the tool docs told agents that deleting the thread's own worktree leaves the thread (and every fork of it) unusable, so they stop and ask first.juliusmarminge commentedon Dec 2, 2026
Fixed by #47234, now on main: After removing an external worktree, use Choose folder in the missing-workspace warning to select the existing project checkout, then send another message in the same thread with its conversation and link preserved.