Repository navigation
Let a thread drop its worktree without a pull request #22640
scriptease
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
What happened
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:
git worktree removeit 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 (withoutnode_modules).Diagnosis
apps/server/src/orchestration-v2/ProviderTurnStartService.ts(turn start) recreates any missing managed worktree fromprojection.thread.worktreePath/branchand 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 holdsworktreePath/branch.Proposal
A "Remove worktree" thread action, available in the sidebar/thread menu, the command palette, mobile, and the MCP
t3_thread_organizetool so the agent can run it when asked:git worktree remove, and keep the branchworktreePath(the thread falls back to the project root) and record the detachment, so turn start doesn't recreate the worktreeReverse state: "Recreate worktree" from the kept branch, which is what turn start already does today.
Steps to reproduce
git worktree removeyourself.Version
upstream
main8a9d0e0dd(2026-10-21)Related: #17813, #21372
🤖 Generated with Claude Code
All reactions