cmux NEXT: New Cloud Space, a space that is one Cloud machine
Summary
New Cloud Space: a space that is one Cloud machine. Switching to it shows that machine's own workspaces, terminals and browser tabs. Switching back shows the Mac's.
- Create:
space.newCloud(palette, File > New, a Cloud machine's right-click menu,cmux space new-cloud, MCP) picks the target machine, else the one New Cloud Workspace uses, else a new one. It wakes the machine and creates a space in onecreate-profilecommand, withfollows = [machine session]anddefault_session_id = machine session. The daemon already had both fields; nothing in Swift sent them. Running it again for the same machine reuses that machine's space. - Membership: following the session moves the machine's unpinned workspaces out of Default and into the Cloud space (
RoomMembership, unchanged). - Creates go to the machine: a create with no machine asked for (Cmd-N, the first workspace of an empty space, the CLI, the palette) resolves the space's default session in
startWorkspaceand runs on that daemon. A paused machine resumes on that create, and the workspace is made once it connects. - Mac-bound creates stay on the Mac: Finder's New Workspace Here,
cmux open <dir>, a resumed or imported chat, and a create with a command keep running on the Mac. - Paused machine on entry: entering a space whose machine has not loaded waits for its tree. It shows the workspaces the machine already has and creates one only if there are none.
- Unknown machine: if a space names a session that no listed machine serves, the create is refused. It is never pinned onto the Mac.
- Resolution: a session resolves through its live daemon, else through the home registry's transport record, so a paused machine still resolves after a relaunch.
Browsers in a Cloud space are the existing remote-workspace browser tabs: the page renders on the Mac, and the machine's localhost is proxied over the link. A page that runs inside the VM is still the opt-in "Open on " path.
Follow-ups, not in this PR:
- Set Default Session / Follow Session actions (data-model.md :411).
- Machine health on the space switcher.
- Delete Space and
forget-sessioncleanup for a deleted machine. - An in-flight guard against two quick runs creating two spaces for one machine.
Changelog
Added: New Cloud Space, a space that shows one Cloud machine's workspaces, terminals and browser tabs, and creates new workspaces on that machine.
Testing
New CloudSpaceTests (CmuxNextAppTests) cover:
- A Cloud space resolves to its paused machine's daemon (no identity this run).
- A plain space resolves to the Mac.
- A space whose machine is missing refuses.
- Mac-bound spawns stay on the Mac.
followsmoves the machine's workspaces out of Default.create-profilesendsdefault_session_idandfollows.
Also run: SpaceSurfacesTests, ActionSurfaceParityTests, ActionSurfaceExportTests and MachineIconTests.
The base (c5af8772d57) does not compile: JoinConsent+App.swift:222 calls the async FolderChanges.events() from sync code. https://github.com/manaflow-ai/cmux/pull/27722 and https://github.com/manaflow-ai/cmux/pull/27758 fix that, so the suites ran on side branch cloud-space-test-side: this head plus https://github.com/manaflow-ai/cmux/pull/27722's commit.
Observed / Not run
- Observed:
prepush-gate.pypasses (only app-size warnings). The fleet suite results are in the comment below. - Not run: a live Cloud machine dogfood on a tagged build.
No capture: the only visible change is one menu and palette row, "New Cloud Space". The behavior needs a signed-in Cloud machine, which the capture minis do not have. A tagged dogfood build follows.
š¤ Generated with Claude Code
![View with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png)
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Adds New Cloud Space, a space that shows one Cloud machine's workspaces, terminals, and browser tabs, and creates new workspaces on that machine instead of the Mac.
New Features
space.newCloud(palette, File > New, a Cloud machine's right-click menu,cmux space new-cloud, MCP) picks the target machine, wakes it, and creates the space in onecreate-profilecommand withfollowsanddefault_session_id; running it again reuses the existing space. The machine's session leaves Default's follows, so its workspaces show only in the Cloud space.- Creates with no machine asked for (Cmd-N, an empty space's first workspace, the CLI, the palette) resolve the space's default session and run on that daemon; a paused machine resumes and the workspace is made once it connects. A create naming a machine that does not resolve is refused, never made on this Mac instead.
- A Cloud machine whose daemon can start and attach chats opens the New Tab page first in a new workspace, built for that machine; a machine without those capabilities keeps the terminal.
- Mac-bound creates ā Finder's New Workspace Here,
cmux open <dir>, a resumed or imported chat, a create with a command or browser profile, first launch's workspace, and a script's create without--sessionā stay on the Mac. - Entering a space whose machine has not loaded waits for its tree, shows the machine's existing workspaces, and creates one only if there are none; a failed wake or load returns the window to the space it can show now (its previous, else default, adopting its workspaces from a closed window before making one), never into another unloaded space's wait.
- Switching to a space naming a session no listed machine serves is refused and the window keeps its space; sessions resolve through their live daemon, else the home registry's transport record, so a paused machine still resolves after a relaunch.