You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Let a thread drop its worktree without a pull request #22635
Some workflows can't use a pull request (Gerrit, cherry-picking into another branch, local-only experiments). Once the work has landed elsewhere, the thread's worktree has no clean exit:
Deleting the worktree is only offered when deleting the whole thread.
"Delete settled worktrees" (storage cleanup) only removes it after settlement.
Asking the agent to git worktree remove it works only until the next message: the next turn recreates the worktree from the thread's branch.
Observed: the agent removed ~/.t3/worktrees/<project>/<branch> at 04:49:43, the next user message started a turn at 04:50:29, and by 04:50:42 the worktree was back as a fresh checkout (without node_modules).
Diagnosis
apps/server/src/orchestration-v2/ProviderTurnStartService.ts (turn start) recreates any missing managed worktree from projection.thread.worktreePath / branch and logs "provider turn start recreating missing worktree". That's correct after storage cleanup or a rollback. But T3 has no way to learn that a removal was intentional, because the thread still holds worktreePath / branch.
Proposal
A "Remove worktree" thread action, available in the sidebar/thread menu, the command palette, mobile, and the MCP t3_thread_organize tool so the agent can run it when asked:
refuse, or ask for confirmation, when the worktree has uncommitted changes or unpushed commits
stop the session, run git worktree remove, and keep the branch
clear the thread's worktreePath (the thread falls back to the project root) and record the detachment, so turn start doesn't recreate the worktree
leave the thread settleable
Reverse state: "Recreate worktree" from the kept branch, which is what turn start already does today.
Steps to reproduce
Run a thread in a managed worktree and finish the work without a PR.
Ask the agent to remove the worktree, or run git worktree remove yourself.
Send any follow-up message. The worktree is recreated.
Activity