You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Worktree retention has no periodic sweep: grace-period crossings while the app runs are never reclaimed #641
enforceRetention runs exactly twice in the app's life: once at boot (+15 s, electron/main.js:380-405) and on archive/merge events (scheduleRetention). Nothing re-checks on a timer.
Live evidence (2026-08-21): of 62 worktree dirs (48 GB), 61 belong to archived threads. 42 of those are inside the 3-day UNMERGED_GRACE_MS window (worktrees.js:3877) — they will cross grace while the app stays running, and with multi-day uptimes nothing will reclaim them until the next launch or the next archive. The result: the worktree dir regrew 29 GB → 48 GB in two days even with retention=10 persisted on every project.
Fix: a low-frequency unref'd interval (e.g. every 6 h, same pattern as createPrStateRefresher) that calls enforceRetention({ store, worktreeBase, broadcast }). Cheap when there is nothing to do: enforceRetention already early-returns before any disk walk when no project has explicit retention.
createRetentionSweeper (same shape as createPrStateRefresher): unref'd startup at 15s, then every 6h, overlap latch, failure-silent via scheduleRetention. Cheap no-op when no project sets a limit.
The boot +15s timer is now orphan-sweep only. Archive/merge still call scheduleRetention immediately.
Activity
currentbits commentedon Aug 22, 2026
Implemented in this worktree.
createRetentionSweeper(same shape ascreatePrStateRefresher): unref'd startup at 15s, then every 6h, overlap latch, failure-silent viascheduleRetention. Cheap no-op when no project sets a limit.The boot +15s timer is now orphan-sweep only. Archive/merge still call
scheduleRetentionimmediately.Tests:
electron/test/retention-sweep.test.js(timers, unref, latch, default sweep, main.js wiring).fix(worktrees): periodic retention sweep so grace crossings are recla…
Reconcile local main with origin/main