Repository navigation
Reclaim idle worktree space automatically on dev startup - #28864
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
Actionable comments posted: 2
🔇 Additional comments: 1
config/scripts/reclaim-worktree-command.mjs-70-70: 1
70-70: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.Do not prompt in a non-interactive CI job with a pseudo-terminal.
If CI supplies TTY streams but no operator input, this condition waits indefinitely after the preview. Check CI indicators before creating the prompt, and leave that run preview-only. Based on learnings, Node.js CLI tools should check CI indicators rather than gate prompts solely on TTY status.
Source: Learnings
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
0761782c-4954-4d35-a4fe-f20c7bb1234f
📒 Files selected for processing: 15
config/scripts/dev-storage-reclaim.mjsconfig/scripts/dev-storage-reclaim.test.mjsconfig/scripts/reclaim-electron-dists.mjsconfig/scripts/reclaim-electron-dists.test.tsconfig/scripts/reclaim-release-test-caches.mjsconfig/scripts/reclaim-worktree-command.mjsconfig/scripts/reclaim-worktree-command.test.mjsconfig/scripts/reclaim-worktree-space.mjsconfig/scripts/reclaim-worktree-space.test.mjsconfig/scripts/run-electron-vite-dev.mjsdocs/readme/release-source-sharing.mddocs/readme/worktree-storage-maintenance.mdpackage.jsonsrc/main/startup/run-electron-vite-dev-web.test.tssrc/main/startup/run-electron-vite-dev.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
ELI5
Idle Electron bundles in other branches used to accumulate until someone ran cleanup manually. Starting
pnpm devnow starts safe cleanup across the repository in the background.pnpm reclaim-spacereplaces the three package commands and lets you apply the preview by answeringY.What Changed
ORCA_SKIP_DEV_STORAGE_RECLAIM=1opts out.pnpm reclaim-spacepreviews and offers[y/N]in a terminal.--applyruns directly; redirected input/output stays preview-only unless--applyis supplied.--tests-stoppedin both preview and apply. Automatic cleanup never touches them, even with that flag.The PR also fixes a test recently merged into
main: spying on every filesystem export replaced real stream internals and caused ten CI timeouts. The test now spies only on the content-read functions it observes.Why
Reuses the existing sweep, repository lock, process checks, and atomic Electron sharing instead of introducing another cleaner. Running it in a separate worker avoids adding the filesystem sweep to startup and lets the worker release its lock if the dev app exits. Keeping historical test caches explicit protects older test runners that still import them.
Linked Issue
Fixes #28863
Visual Proof
Captured terminal transcripts from a disposable macOS repository before the command was renamed to
reclaim-space; the bundle remained after preview and was removed only afterY. These images render the recorded text; they are not Orca window screenshots.Before:

After:

Testing
Y→ apply flow in a disposable repository on macOS; checkedpnpm reclaim-space --help.ORCA_BACKGROUND_LAUNCH=1.main, all 53 transcript-search tests in the four affected suites passed, including the 13 cases in the previously failing suite.pnpm tc:node,pnpm run check:code-quality:changed,pnpm run check:max-lines-ratchet, and commit lint/format checks passed.Review
Self-reviewed lock release, failed preview, redirected input, startup failure, current-worktree exclusion, and test-cache retention.
Agent skill upstream boundary
Checklist