Repository navigation
Cloud: resume paused machines on attach, add Pause When Idle (app) - #23713
Conversation
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
|
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)
Passes: CI passes on CI passes on Written by red: cmux-next checks (god files, concurrency, crash safety, l10n); base red: the same failure on the base ab0ad6a; does not block
Agents: Tour of The path-selected recorder failed for core-after, core-before; see the run artifact and failed manifests. Path-selected interactions
Core UI (before): FAILED — 16 ok, 3 failed, 1 unavailable
Failed steps: 5. Split right Screenshots (12)1. Launch
Failed steps: 5. Split right Screenshots (12)1. Launch Tours are data in |
|
Owned by cloud-team-ready on cosmic-gray · session |
|
Found 12 test failures on Blacksmith runners: Failures
...and 2 more test failures. View all on Blacksmith: run 39717782191, run 39717782302
|
|
Bead |
804986c to
1c225a2
Compare
|
|
The app side of the idle auto-pause (the server side is its own PR). Attaching to a paused machine resumes it first through Resume Machine's path: open machine, new terminal (CLI answers pending past 30 s), ssh, new Cloud workspace, moving a chat, a terminal's Connect and Retry. A paused machine's stage is paused, never failed, including after its app link ended because the machine paused; a failed resume says why. Pause When Idle... sets the machine's timeout (Off, 15, 30, 60 or 120 minutes; the server default is 30), with CLI parity: cmux cloud set-idle-pause --target machine:<id> --minutes off|15|30|60|120. The machine record decodes pauseReason and idlePauseMinutes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d3e-acc6-7a03-a574-453e3de27340&host=cosmic-gray
1c225a2 to
975a761
Compare
|
|
…sume does not outlive the next pause - The app reads the machine list on launch and activation only, so a machine the idle auto-pause parked while cmux stayed in front still read running: the header showed Failed, Retry only woke the daemon, and ssh and new terminal refused "not connected". A legacy machine with no daemon connection now reads its record again before an attach (open, ssh, new terminal, moving a chat) and before Retry decides; the list is also read after the Mac wakes and after a legacy link start fails (throttled to 30 s). - resumeFailure clears on a real connect and on every suspend, so a failed resume no longer turns a later pause into Failed. - A legacy link start that a pause overtook changes nothing (noteLink checks suspends), so a late socket failure cannot turn a paused machine into Failed or Starting. - Moving a chat stops waiting at once when the resume failed, with its reason, instead of waiting out 180 s. - The cmux-next backend's record maps pauseReason and idlePauseMinutes. - New terminal's pending answer says resuming only for a paused machine. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d3e-acc6-7a03-a574-453e3de27340&host=cosmic-gray
|
|
scripts/cmux-next/regenerate-action-exports.sh on the fleet at f67effc (steps ca18e44f6afe4541045e6c31 and 4556682f68f808ea7aa08207, aws-m4pro; ActionSurfaceParityTests passed): the new cloudSetIdlePause action in action-surfaces.json and the counts and Connection folder in actions.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d3e-acc6-7a03-a574-453e3de27340&host=cosmic-gray
Keeps base key order in ActionCatalog.xcstrings and appends only action.cloudSetIdlePause. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d3e-acc6-7a03-a574-453e3de27340&host=cosmic-gray
Regenerated on the fleet (steps of regenerate-action-exports.sh at dd18971); differs from base only by cloudSetIdlePause. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d3e-acc6-7a03-a574-453e3de27340&host=cosmic-gray
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
CloudMachine.swift: keep both the idle-pause fields (pauseReason, idlePauseMinutes) and the cost-line fields from #23691. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d3e-acc6-7a03-a574-453e3de27340&host=cosmic-gray
|
Review (subagent, correctness first): SHIP at ce72f7d An independent reviewer read the diff at d6ba959. A second independent review covered the base merge to ce72f7d (base ee1c31a). The one conflict, in What the review confirmed:
It is safe to land without #23836. Two of the minor notes (the old paused text and the spinner on a paused creation row) are what #23836 fixes.
The reds are all in files this PR doesn't touch, and all are red on base: the convention check on |
|
Shipped in:
|
































![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Pilot blocker 1a, Mac app half: attaching to a Cloud machine the idle auto-pause parked resumes it, a paused machine never reads as Failed, and Pause When Idle… sets each machine's timeout.
This is the second of three PRs. The server (the idle detector, the cron and
PUT /api/vm/:id/idle-pause) is #23834: merge #23834 first, since this PR's setting calls its route. Until #23834 is deployed, the setting answers with the server's error and everything else here works against today's server (resume uses the existing Resume Machine API). The "Paused (idle)" labels and the Resume button title are #23836, which is stacked on this PR.What changes
CloudService.resumeMachine, then connects: open machine; new terminal (for the CLI, the answer ispendingif the resume outlasts 30 s); ssh; new Cloud workspace; moving a chat to the machine; a terminal's Connect; Retry. Two attaches during one resume start one resume.paused, including when its app link ended because the machine paused. It reads "Paused" in the progress view, whose Retry button resumes it; the sidebar header keeps its link state instead of "Failed to start". A failed resume says why.cmux cloud set-idle-pause --target machine:<id> --minutes off|15|30|60|120. A non-person caller gets{machine_id, idle_pause_minutes}back, following cmux NEXT: Cloud machine actions from the CLI need --target and return their result #23155.cloud statusreportspause_reasonandidle_pause_minutes. The default (30 minutes, on) is the server's.pauseReasonandidlePauseMinutesfrom/api/vmand from the cmux-next backend's record; an older server, or an unknown value, decodes as absent.plans/cmux-next/action-surfaces.jsonandactions.mdare regenerated for the new action (fleet stepsca18e44f6afe4541045e6c31and4556682f68f808ea7aa08207, whereActionSurfaceParityTestspassed).Tests
CloudIdlePauseTests: the record decodespauseReason/idlePauseMinutes(and tolerates an older server); a paused machine's stage is paused, not failed; an ended app link on a paused machine is paused, not failed, while a live machine's ended link still fails; the sidebar header of a paused machine is not Failed; the progress view shows its buttons; attach resumes, once; attaching to a live machine resumes nothing; a failed resume says why; a failed resume does not outlive the next pause; an attach to a stale running record reads it again and resumes (throughCloudHandlers.attached); an attach to a paused machine waits for its resume and fails with its reason; thecloud set-idle-pausedescriptor has exactly the five choices; CLI, MCP and script runs get the stored value back; invalid choices are refused.Red proof: fleet step
7b72e086d58ff3002a4c1ad6at the test-only scratch commit1a4e38ce939ca804a713a04820a1f2f35d124d67ran the original set (all three PRs' tests) red before the fix. The ended-app-link, stale-record and stale-failure cases were added after that run, from review.Observed / Not run
Not run locally: no Swift compile or tests on this Mac (agents don't build here).
scripts/cmux-next/prepush-gate.pypassed. CI runs the Mac compile and tests.No capture: the visible change is a paused machine reading "Paused" instead of "Failed" and one menu item; the tests above cover both. No real Cloud VM was created.
Changelog
Added: opening, attaching to or running a command on a paused Cloud machine resumes it; Pause When Idle… sets a machine's idle timeout.
🤖 Generated with Claude Code
Agent session: cosmic-gray