feat(desktop): add a Storage view, autopilot cleanup, and pressure notifications - #1149
Merged
Merged
Conversation
janicduplessis
force-pushed
the
feat/1116-desktop-storage
branch
from
September 25, 2026 06:46
2f9d395 to
05ad1da
Compare
This was referenced Sep 25, 2026
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.
Description
Stim Desktop shows free disk and per-workspace CPU and memory, but not what uses the disk, and it never cleans up on its own even though it is always running. Reclaiming space on 2026-09-25 took terminal commands and
duto find where 150+ GB went. The maintainer decided that Desktop autopilot is on by default.Solution
All Stim state still comes from CLI JSON, and every action is a
stimcommand. The app never reads or writes$STIM_HOME.Storage view (sidebar, Machine > Storage)
gc --deleteverdict come fromstim gc --json.node_modulesand the workspace's owned simulators and AVDs are sized by the app withdu.duruns in the background at low priority, and the results are cached for 15 minutes, so opening the view never waits on it.linkedWorktrees(feat: gc removes worktrees whose branch is merged #1133).gh pr listin each repository whenghis on the login shell'sPATH. Withoutghthe view shows a note, and merged and stale still work.gc --jsonagain, then confirms using that fresh list, then runsstim worktree remove <path>for each merged worktree, one after another in a single activity run.gc --json --cache <name>. The activity sheet's Delete now runs that same scope with--delete, so a preview of one cache can no longer escalate into a fullgc --delete.~/Library/Caches. Stim caches inside those folders are subtracted so nothing is counted twice.gc --json, then runsgc --delete.Autopilot (App preferences, on by default; checks every minute)
gc --idle <N>m(feat: report device activity in status and shut down idle devices with gc --idle #1101) whenstim statusshows a booted device idle for N minutes (default 1 h). It waits while a device the CLI counts as idle has a screen the app saw change (feat(desktop): show device activity on tiles and offer idle shutdown #1107), becausegc --idlewould shut that device down too.gc --deleteat the chosen hour (default 03:00), or at the next check if the Mac slept through that hour. Like anygc --delete, this clears the build outputs of every workspace not in use and empties the parked device pool. The README and preferences state this. The first launch, turning the option on, and changing the hour only record the time, so none of them triggers a cleanup. Idle shutdown skips devices with a build running, asgc --idledoes.budget.minFreeDiskGbandbudget.hardFloorDiskGb(feat: enforce disk and memory budgets before builds, reclaiming automatically #1132) fromstim settings --json. Below the budget it runsgc --delete, at most once an hour.Pressure notifications and plan. While disk is under the budget:
stim gc --delete). The sidebar also marks Storage.Trade-offs
stim worktree removeinstead, and build outputs are cleared through the--cache workspacesrow.node_modulesis measured at the worktree root.CLI quirk (not changed here).
stim settings --jsonreports a value set by an environment variable as the variable's raw string (for example"40"). StimKit accepts numeric strings for the budget.Test plan
Automated
swift buildcompletes, andswift testpasses 78 tests. New StimKit tests cover:duparsing with partial outputghghoutput parsing--cachename uniqueness (the CLI matches by substring, so Empty… is disabled when a name would also select another cache)--deleteargumentspnpm run format:check,lint,typecheckandknippass.Manual, bundled app
STIM_HOMEwith scratch worktrees (one merged, one active, one idle for 12 days) andSTIM_BINset to this branch's CLI, withSTIM_BUDGET_MIN_FREE_DISK_GB=40. One real worktree of this repo with an open PR was registered only in the scratch home, and only for the dry-run screenshot.duandgh pr listboth ran.stim gc --deleteagainst the scratch home only: it cleared 286 MB of build outputs and removed the merged worktree. The view refreshed afterwards, and the run appeared in the activity log.Storage view with the pressure plan, lifecycle column (merged, PR open from

gh, stale) and sizes:Do it runs

stim gc --delete:After the run:

Autopilot preferences and activity log:

Not verified: the Do it action on a delivered notification, because banners can't be interacted with while the screen is locked. An idle-device shutdown run was also not seen: the scratch home had no booted devices.
Fixes #1116