Repository navigation
Queue storage cleanup and run worktree removal in the background - #6293
Merged
Merged
Conversation
The Storage page's per-row worktree removal held one HTTP request open for the whole `git worktree remove`. Through bb connect that request hit the 30s response deadline and failed with HTTP 504, and the host worker killed git after its 60s command timeout, leaving multi-GB checkouts half-deleted with their tracked files shown as uncommitted deletions. The page now calls startRemoveExternalWorktree, which rechecks the worktree, returns skipped reasons or "started", and removes it in the background. Host reports carry externalWorktreeRemovals so the row stays busy and the page toasts on completion. git worktree remove no longer has its own timeout; the host call deadline still bounds it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Storage page showed inline "Removing…" lines, row spinners and progress banners, and disabled the page's cleanup buttons while any background job or row action ran. Progress, results and failures now appear only in toasts, and no control locks while work runs; the server's per-machine lock still rejects a conflicting cleanup, which surfaces as an error toast. Row actions reuse a caller's toast id and leave background work's loading toast for the server's result. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Human comments
What was wrong
Removing an external worktree from Storage held an HTTP request open until Git finished. Large checkouts could exceed BB Connect's 30-second response deadline, and a separate 60-second Git timeout could interrupt deletion. Moving removal into the background exposed another problem: enabled cleanup controls submitted overlapping requests that the server rejected with maintenance-lock errors. Bulk cleanup blocked individual deletions and vice versa, with no queue.
What changed
startEntryCleanupand pollentryCleanup, so queued UI requests do not hit remote HTTP deadlines. Existing synchronous CLI/RPC commands participate in the queue and return their final results.How you verified
pnpm exec turbo run typecheck test lint --filter=bb-plugin-bb--storage-retentionpassed; all 79 tests across 4 files passed in an uncached test run.This worktree is already being removed; it passes after the fix.pnpm start:worktree: removed disposable worktrees with 100,000 files each, queued an individual removal behind bulk removal, observed queued → success without conflict errors, and confirmed the dirty worktree remained. Checked the resulting server statuses and inspected a screenshot.git diff --checkpassed. The verification server remains available for manual testing.