What Changed#
- Stop a turn before provider startup when T3 cannot recreate its missing worktree.
- Show an actionable error that tells the user to restore the worktree or select another branch.
- Keep the branch selector available and load refs from the project checkout when the saved worktree is gone.
- Rebind the thread to the selected checkout so later turns keep the existing history and resume normally.
Why#
T3 already tries to recreate a missing worktree. That recovery fails when the worktree branch was also deleted. T3 then started the provider in the deleted directory and showed a provider spawn error on every new turn.
This change completes the branch-deleted case discussed in #6197. It builds on the automatic recreation from #7839 and the missing-folder error from #5040.
UI Changes#
Before rebinding#
After rebinding#
Verification#
pnpm exec vp test run apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts apps/web/src/components/BranchToolbar.logic.test.ts --maxWorkers=2 (139 tests)
pnpm exec vp run --filter @t3tools/web typecheck
pnpm exec vp run --filter t3 typecheck
- Targeted lint and format checks for all changed files
- Isolated browser test with a disposable T3 home: create a thread worktree, delete its worktree and branch, restart T3, rebind the thread to
main, and continue the same thread
Checklist#
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed