cmux NEXT spaces: hidden-space hibernation follow-ups (exports, re-armed deadline, agent policy)
Follow-up to #30666 (hidden-space hibernation, leo-workspace design/spaces.md "Hibernation and the perf plan").
Leo, 2026-10-29: "...new windows being like new spaces, incognito spaces, etc... this could legit make our thing more useful than chrome by having windows be switchable in this way. think of the potential perf savings~"
#30666 was merged at 01e8059 before two of its own pieces landed:
- its regenerated settings exports;
- an independent review.
This PR finishes it.
What changes
- Settings exports regenerated (
schemas/settings/settings-schema.json,docs/mdm/*, the docs settings reference) forworkspaces.hibernation.hiddenSpaceMinutes. They come fromscripts/cmux-next/regenerate-settings-exports.shon the fleet (step222a3938c3f94afd8319a3c0). Without them,SettingsSchemaExportTestsand the export checks are red on base from #30666. That red is ours. - A newly hidden space is re-planned (cubic P1 on #30666, then the BLOCK at
094c93a). The pending deadline was planned on the old shown set at the normal 60-minute clock. A window that switched space could then hide a space whose workspaces should come due at 15 minutes, and the pass waited out the later deadline instead. Now a workspace leaving the shown set, or a space leaving the shown spaces, arms a pass a minute out, but never postpones a pass already due sooner, so switching back and forth cannot starve it. The existing shown-set follow also readshibernationShownSpaces(), so a switch that hides a space without changing the shown workspaces is caught. There is no new timer: it is the sameDemandTimerdeadline,stop()still cancels it, and the plan still cancels it when nothing will come due. hiddenSpaceMinutesis.userOnlyfor agents, like the other two hibernation rows (cubic P2).- Test cleanup: the coordinator tests remove their
UserDefaultsdomain (cubic P2). - Bench (
bench_workspace_hibernation.py --hidden-spaces K):- one setup path for both modes (cubic P3);
- at most 7 hidden spaces, since
space.selectByNumberreaches spaces 2 to 8 (cubic P2); - the doc names the uncounted first workspace of a new space, and the requirement that
--hidden-minutesexceed the setup time (cubic P2).
Commits:
- Failing test.
- Fix.
- Exports.
- Failing tests for the review's starvation and same-workspace cases.
- Their fix.
- A base merge.
Open follow-ups:
Tested on the fleet at fbf44f9 (step 8899f6c5f0650e1c421d8c11), with SettingsSchemaExportTests also passing: HiddenSpaceHibernationTests, HiddenSpaceHibernationCoordinatorTests, WorkspaceHibernationPlannerTests and WorkspaceHibernationTests pass.
Performance
Not measured. Neither the before nor the after harness run could start: scripts/measure/tab-hibernation.sh builds the app with the same-tree cmux-tui, and no feat-cmux-next commit in the last 15 has published one. Fleet step 27ba501588647a5bb865b20c reported "no cmux-tui artifacts run will publish tree 590d14ee…"; the base cmux-tui clippy and ratchet reds are being fixed in #30555, #30630 and #30661. The harness is ready:
cmux-ci run --class exclusive --label measure --script scripts/measure/tab-hibernation.sh --ref <sha> --arg=--workspaces=6 --arg=--hidden-spaces=3 --arg=--hidden-minutes=5 --arg=--config=bench
The run measures:
- before vs after: 1 window, 3 hidden spaces of 6 workspaces each, past the threshold;
- footprint, RSS, renderer RSS, idle CPU and wakeups/s;
- switch-back time to the first usable page.
#30855 tracks the run and the threshold check for the shipped 15 minutes.
| metric | before | after | delta | harness or run link |
|---|---|---|---|---|
| total footprint, 3 hidden spaces past threshold | not run | not run | n/a | step 27ba501588647a5bb865b20c (blocked: cmux-tui tree unpublished) |
Agent session: agent session
🤖 Generated with Claude Code