cmux NEXT Cloud: agents' and lane-pool machines stay out of the sidebar until you open them

Merged
TE
8d ago
+582-10

Leo, 2026-10-29: "why is there all this weird stuff at the bottom of the sidebar" / "a whole lot of this cloud stuff ought to get better...". Standing order the same day: "no new workspaces or terminals as side effects".

What was wrong

  • CloudService.reconcile connects every Cloud machine of the account that isn't destroyed, including the VMs agents and lane-pool tools make.
  • Each machine's daemon starts with a workspace from its image (bash in the home folder).
  • reconcileMembership collects every workspace of every daemon. WindowRegistry.reconcile gives each unowned one to the most recent window.
  • So every agent, lane-pool or test VM put a "cmux · ~" row and a bare home-folder row into the person's sidebar.
  • On top of that, cmux cloud new-machine from a tool without focus filed the new machine's first workspace into the active window (reveal).

Fix

  • Membership (WindowManager+Membership.swift): a Cloud machine's workspaces join a window only once the person has opened that machine here. Opened means one of its workspaces is in a window (open or closed) or claimed for one: Open Machine, New Cloud Workspace, a create with focus. Until then reconcile holds them (unopenedCloudWorkspaces), so they show in no sidebar. Opening the machine brings them in, and machines the person already uses behave as before.
  • Only a machine's own ids count toward "opened". A VM made from another VM's snapshot keeps its workspace keys, so a window holding the other machine's copy must not open this one.
  • Creation (CloudHandlers.creationFlow): a machine created without a window to show it in is filed (reveal) only when the person started it. An agent's or the CLI's cloud new-machine without focus leaves it out of the sidebar. With --focus it shows, as before.
  • No sidebar row or layout file changes. The row rendering (the gap, the header, the home title) is fixed in separate PRs.

Tests

Tests/CmuxNextAppTests/UnopenedCloudMachinesTests.swift, committed before the fix (3504896f274):

  • a fresh machine's image workspace joins no window and opens none
  • a machine that already has a workspace in a window takes new ones in
  • a workspace key shared with an opened machine does not open another machine
  • an agent's create files nothing; the person's create shows its workspace

Command: swift test --filter UnopenedCloudMachinesTests (CmuxNextAppTests, macOS). Expected red at 3504896f274 and green at the head. Results are posted below once CI runs.

Also adds the Debug capture scene cloud-agent-machines: two running Cloud machines, never opened here, each with its image workspace, for the before/after stills.

Observed

Before / after

Scene cloud-agent-machines at 2x, cropped to the sidebar. Before is d5fecc84 (base); after is the head.

LightDark
Beforebefore lightbefore dark
Afterafter lightafter dark

Viewed after image: yes
Visual verdict: the two never-opened agent machines' "workspace-1" rows are gone and the sidebar shows only the person's own workspaces, which reads cleanly next to ChatGPT or Claude.

Changelog

  • Fixed: Cloud machines that agents or tools create no longer add rows to your sidebar until you open them.

risk:normal

Agent session: agent session

🤖 Generated with Claude Code