Repository navigation
fix(worktrees): periodic retention sweep so grace crossings are reclaimed while the app runs (#641) - #657
Merged
currentbits merged 4 commits intoAug 22, 2026
Conversation
… We still have 5 items on in progress bt i think we finished
… Before when we had a pr it showed a link in the related thre
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
currentbits
deleted the
coder/fork-worktree-retention-has-no-periodic--c4fa2e
branch
October 3, 2026 16:07
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.
Closes #641.
enforceRetentiononly ran at boot (+15s) and on archive/merge, so a worktree crossing its grace period during a multi-day uptime sat on disk until the next launch.createRetentionSweeper()inelectron/worktrees.js: startup pass at 15s, then every 6h. Unref'd timers, boolean overlap latch (a tick during a running pass is a no-op, not queued), and it delegates to the existingscheduleRetentionso failures stay silent. Same shape ascreatePrStateRefresher.electron/main.js: the boot timer now only runs the orphan sweep; retention is owned by the sweeper, started inwhenReadyand stopped ininstallShutdownnext to the PR refresher.electron/test/retention-sweep.test.js: 9 tests over interval defaults, unref'd scheduling, the overlap latch (including latch release after a throwing pass), stop, the defaultscheduleRetentionsweepFn, and the main.js wiring.Cheap when idle:
enforceRetentionreturns before any disk walk if no project sets a limit.Size note: 437 lines vs the 400 cap, 270 of which are the new test file. Opened oversize deliberately rather than shipping the sweeper without its tests.