Repository navigation
feat(web): worktree cleanup runs in the background with top bar progress - #290
Merged
Merged
Conversation
The dead-worktree scan blocked a modal for up to an hour. It walked every file in every candidate worktree to size it, held the project's git command lane the whole time, and threw its results away if the dialog closed. - Scan without sizes (new optional includeDiskBytes flag), then measure each worktree with a new vcs.measureWorktreeSize RPC, two at a time. - Scan and size RPCs get their own client lanes so the user's git actions never queue behind them. - New module-level job store owns scan, sizes and delete; the dialog is a single global view over it. Delete runs one worktree per call for progress, with git gc only on each project's last one, and can be stopped. - Status pill in the chat, empty-state and settings headers reopens the dialog; a toast reports when a step finishes while it is hidden. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
"Clean up dead worktrees" blocked a modal on "Scanning for dead worktrees..." for up to an hour. Three causes:
node_modulesincluded. That means hundreds of thousands of filesystem calls per worktree on Windows.Fix
vcs.scanCleanupCandidatestakes an optionalincludeDiskBytesflag. It defaults to true, so older clients behave the same.vcs.measureWorktreeSizesizes one managed worktree. It refuses paths outside the managed worktrees directory.worktreeCleanupJob.ts) owns the scan, sizes and delete.git gconly on each project's last worktree. It can be stopped after the current worktree.Verification
measureSize, including the out-of-directory refusal.gcplacement, progress labels and the wording when sizes are unknown.check:avicode.Not exercised in the browser: the sidebar project action. It is a one-line switch to the same
startWorktreeCleanupScancall, and typecheck covers it.Screenshots were captured locally during the integrated pass; the pill sits left of "Add action" in the chat header.
Done by Claude Opus 5.5 (1M context) in Claude Code.
🤖 Generated with Claude Code