[Bug]: Deleting a thread's worktree discards uncommitted changes without warning
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/web
Steps to reproduce
- Create a thread in worktree mode.
- In the worktree, edit a tracked file and leave it uncommitted.
- Delete the thread and answer yes to "Delete the worktree too?".
Expected behavior
T3 Code runs git worktree remove without --force first. If Git refuses because of local changes, it shows what would be lost and asks again before forcing.
Storage cleanup already works this way: storageCleanup.ts checks for local changes before it removes a worktree. Deleting a thread doesn't.
Actual behavior
The edit is gone. The dialog doesn't mention uncommitted changes, and useThreadActions.ts then calls removeWorktree with force: true, which skips Git's own dirty check. With automatic worktree cleanup on delete turned on, there is no dialog at all.
The same happens to a nested checkout inside the worktree, such as another repository's worktree that a setup script placed in a subdirectory. Its edits are lost too, and that repository keeps a stale prunable entry in git worktree list.
Impact
Major degradation or frequent failure
Version or commit
0.1.9
Environment
Ubuntu 26.04.1, T3 Code desktop 0.1.9, git 2.53.0