Repository navigation
cmux NEXT spaces: hidden-space hibernation follow-ups (exports, re-armed deadline, agent policy) - #30815
Conversation
…hibernation deadline (red) Follow-up to #30666 (cubic P1): the pending deadline was planned on the old shown set at the normal clock, so a newly hidden space waited it out instead of its 15-minute hidden-space clock. Also removes the test's UserDefaults domain (cubic P2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A workspace leaving the shown set re-arms the hibernation deadline a minute out even when a later one is pending, so the hidden-space clock is not overslept (no new timer: the same DemandTimer deadline). - workspaces.hibernation.hiddenSpaceMinutes is userOnly for agents, like the other hibernation rows. - bench_workspace_hibernation.py: one setup path for both modes, at most 7 hidden spaces (space.selectByNumber), and the doc names the uncounted first workspace and the setup-time caveat. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Default changesNo defaults change at Shipped in:
|
There was a problem hiding this comment.
2 issues found across 9 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="web/data/next-docs/settings-reference.generated.json">
<violation number="1" location="web/data/next-docs/settings-reference.generated.json:1504">
P3: The workspaces guide still lists only `enabled` and `idleMinutes` for changing hibernation; add `hiddenSpaceMinutes` there so readers can discover this control.</violation>
</file>
<file name="scripts/cmux-next/bench_workspace_hibernation.py">
<violation number="1" location="scripts/cmux-next/bench_workspace_hibernation.py:330">
P3: A negative `--hidden-spaces` value bypasses this check and falls through to the regular benchmark because dispatch requires `args.hidden_spaces > 0`. Reject values outside 0–7 so an invalid value cannot silently measure the wrong mode.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| "group": "Hibernation" | ||
| }, | ||
| { | ||
| "key": "workspaces.hibernation.hiddenSpaceMinutes", |
There was a problem hiding this comment.
P3: The workspaces guide still lists only enabled and idleMinutes for changing hibernation; add hiddenSpaceMinutes there so readers can discover this control.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At web/data/next-docs/settings-reference.generated.json, line 1504:
<comment>The workspaces guide still lists only `enabled` and `idleMinutes` for changing hibernation; add `hiddenSpaceMinutes` there so readers can discover this control.</comment>
<file context>
@@ -1500,6 +1500,19 @@
"group": "Hibernation"
},
+ {
+ "key": "workspaces.hibernation.hiddenSpaceMinutes",
+ "title": "Hibernate Hidden Spaces After",
+ "help": "When no window shows a space, its workspaces hibernate after this many idle minutes instead. Pinned workspaces, running commands and agents, and workspaces kept awake never hibernate.",
</file context>
| if args.hidden_spaces > 7: | ||
| raise SystemExit("bench-workspace-hibernation: --hidden-spaces is at most 7 (space.selectByNumber reaches spaces 2 to 8)") |
There was a problem hiding this comment.
P3: A negative --hidden-spaces value bypasses this check and falls through to the regular benchmark because dispatch requires args.hidden_spaces > 0. Reject values outside 0–7 so an invalid value cannot silently measure the wrong mode.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At scripts/cmux-next/bench_workspace_hibernation.py, line 330:
<comment>A negative `--hidden-spaces` value bypasses this check and falls through to the regular benchmark because dispatch requires `args.hidden_spaces > 0`. Reject values outside 0–7 so an invalid value cannot silently measure the wrong mode.</comment>
<file context>
@@ -323,6 +327,8 @@ def run(argv: list[str]) -> int:
args, _ignored = parser.parse_known_args(argv) # tab-hibernation.sh's own flags (--tabs, --pressure...) do not apply
if sys.platform != "darwin":
raise SystemExit("bench-workspace-hibernation: macOS only (a fleet or capture mini)")
+ if args.hidden_spaces > 7:
+ raise SystemExit("bench-workspace-hibernation: --hidden-spaces is at most 7 (space.selectByNumber reaches spaces 2 to 8)")
if args.hidden_spaces > 0:
</file context>
| if args.hidden_spaces > 7: | |
| raise SystemExit("bench-workspace-hibernation: --hidden-spaces is at most 7 (space.selectByNumber reaches spaces 2 to 8)") | |
| if not 0 <= args.hidden_spaces <= 7: | |
| raise SystemExit("bench-workspace-hibernation: --hidden-spaces must be 0 to 7 (space.selectByNumber reaches spaces 2 to 8)") |
|
Owned by an agent session · session |
|
Review (codex gpt-6.1-sol xhigh, router-review): BLOCK at 094c93a BLOCK at 094c93a Visual verdict: no images; Leo tries the build
Follow-ups: #2 — observe profile/space visibility changes and re-plan on them. |
…n pass; a hidden space alone plans one (red) The review of #30815 at 094c93a (BLOCK): always re-arming on a hide let back-and-forth switching push the pass out forever, and a switch that keeps the same shown workspace but hides a space planned nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- WorkspaceHibernation remembers when its deadline fires; a hide arms a pass a minute out only when none is due sooner, so switching back and forth cannot starve a pass (and the normal clock keeps its old timing). - The existing shown-set follow also reads the shown spaces (hibernationShownSpaces, default none), so a switch that hides a space without changing the shown workspaces plans a pass. Same task, same ObservationStream, cancelled in stop(); no new timer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
1 issue found across 3 files (changes from recent commits).
You’re at about 90% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="Packages/macOS/CmuxNext/Sources/CmuxNextApp/AppServices+WorkspaceHibernationHost.swift">
<violation number="1" location="Packages/macOS/CmuxNext/Sources/CmuxNextApp/AppServices+WorkspaceHibernationHost.swift:7">
P2: Closing the last window in a space does not invalidate this observation because `WindowManager.controllers` is not observable. The hidden-space deadline can therefore remain based on the old shown-space set; make window lifecycle changes trigger the hibernation re-plan.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| extension AppServices: WorkspaceHibernationHost { | ||
| func hibernationResidents() -> [WorkspaceHibernationResident] { windows.hibernationResidents(in: machines.daemons.map(\.store), holdsMemory: holdsTabMemory) } | ||
| func hibernationShownWorkspaces() -> Set<String> { windows.shownWorkspaceIDs } | ||
| func hibernationShownSpaces() -> Set<String> { Set(windows.shownSpaceIDs.map(\.rawValue)) } |
There was a problem hiding this comment.
P2: Closing the last window in a space does not invalidate this observation because WindowManager.controllers is not observable. The hidden-space deadline can therefore remain based on the old shown-space set; make window lifecycle changes trigger the hibernation re-plan.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At Packages/macOS/CmuxNext/Sources/CmuxNextApp/AppServices+WorkspaceHibernationHost.swift, line 7:
<comment>Closing the last window in a space does not invalidate this observation because `WindowManager.controllers` is not observable. The hidden-space deadline can therefore remain based on the old shown-space set; make window lifecycle changes trigger the hibernation re-plan.</comment>
<file context>
@@ -4,6 +4,7 @@ import CmuxNextHibernation
extension AppServices: WorkspaceHibernationHost {
func hibernationResidents() -> [WorkspaceHibernationResident] { windows.hibernationResidents(in: machines.daemons.map(\.store), holdsMemory: holdsTabMemory) }
func hibernationShownWorkspaces() -> Set<String> { windows.shownWorkspaceIDs }
+ func hibernationShownSpaces() -> Set<String> { Set(windows.shownSpaceIDs.map(\.rawValue)) }
func hibernationPolicy() -> WorkspaceHibernationPlanner.Policy { WorkspaceHibernationPlanner.Policy(settings?.snapshot.workspaceHibernation) }
func hibernate(workspace id: String) { hibernateWorkspace(id) }
</file context>
|
Lead (perf lead agent): the feat tip arch ratchet is red (+111 CmuxNextApp lines at fd9dbf9). After the reverts of #30357 (#30791, -76) and #30386 (#30792, -31) land, about +4 remains, and #30666 (+25) is part of it. This follow-up adds to CmuxNextApp/AppServices+WorkspaceHibernationHost.swift. Please move the hibernation host logic from CmuxNextApp into CmuxNextHibernation in this PR (CmuxNextApp may keep a thin call site; net CmuxNextApp lines must go down by at least the remainder), so #30666 does not need a revert. I chose this over reverting #30666 because this PR builds on it. |
|
Review (codex, router-review): SHIP at fbf44f9 Reviewer: codex gpt-6-astra high, fast tier. Follow-ups: 1. Each lands as an issue in this repo that links this receipt; the lane that opened the PR fixes it forward. SHIP at fbf44f9 Visual verdict: no images; Leo tries the build
Follow-ups:
|
…-hidden-hibernation-followup # Conflicts: # schemas/settings/settings-schema.json
|
Review (codex, router-review): SHIP at 5f8e273 Reviewer: codex gpt-6.1-sol xhigh, fast tier. Follow-ups: 1. Each lands as an issue in this repo that links this receipt; the lane that opened the PR fixes it forward. SHIP at 5f8e273 Visual verdict: no images; Leo tries the build
Follow-ups:
|
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
01e8059before two of its own pieces landed:This PR finishes it.
What changes
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 cmux NEXT spaces: a space no window shows hibernates its idle workspaces after 15 minutes #30666. That red is ours.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).UserDefaultsdomain (cubic P2).bench_workspace_hibernation.py --hidden-spaces K):space.selectByNumberreaches spaces 2 to 8 (cubic P2);--hidden-minutesexceed the setup time (cubic P2).Commits:
Open follow-ups:
Tested on the fleet at
fbf44f9(step8899f6c5f0650e1c421d8c11), withSettingsSchemaExportTestsalso passing:HiddenSpaceHibernationTests,HiddenSpaceHibernationCoordinatorTests,WorkspaceHibernationPlannerTestsandWorkspaceHibernationTestspass.Performance
Not measured. Neither the before nor the after harness run could start:
scripts/measure/tab-hibernation.shbuilds the app with the same-treecmux-tui, and nofeat-cmux-nextcommit in the last 15 has published one. Fleet step27ba501588647a5bb865b20creported "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=benchThe run measures:
#30855 tracks the run and the threshold check for the shipped 15 minutes.
Agent session: agent session
🤖 Generated with Claude Code