cmux NEXT sidebar: one group per machine with the agent chats running there (cloud icon, live count, offline)

Merged
TE
12d ago
+697-7

Leo, 2026-10-24, word for word: "the whole ACP MUX thing, like that, it should just be able to show me, say on my sidebar, right? Like we already discussed this, like with the cloud icon, the group where, you know, on a different machine or whatever, there's the other agent sessions, the other workspaces running, but you guys aren't doing that yet."

Earlier ask (ask-427cc7d8f5, 2026-10-22): "by default put the cloud icon on top of group".

Summary

The NEXT sidebar now shows the agent chats running on other machines: one group per acpmux peer that this Mac's daemon mirrors (huge-blue, big-red, cmux16, air-blue, Cloud machines).

  • Header: each group has a header row with the cloud icon, the machine's name and a count of its live chats (working, waiting or idle; closed chats have no lane, so they don't count). The header shows the group's state: waiting on you, then working, then idle.
  • Folding: groups are folded by default. Unfolded, a group lists 10 chats at a time, newest first, then a Show More row. Chats are ordered by their last state change, so a new step doesn't reorder them.
  • Click: clicking a chat opens it in a tab: the tab that already shows it, else the other machine's tree tab, else a new tab in the focused pane. This is the Priority view's path (agentActivityPage.jump). It never opens a terminal or TUI and never creates a workspace.
  • Offline: a peer the daemon can't reach shows as "big-red · Offline", dimmed, with no rows.
  • Placement: the groups are client-only rows (SidebarTransientItem, like the Chief's subagent rows), drawn after Home and the App Store, above the workspaces. They are never written to the layout document, and nothing is created in the app.

Before / after

Real app, fleet build, capture mini. Capture minis run no acpmux peers, so the Debug tunable sidebar.laneFixture is on in both (state: launch, then debug.tunables set sidebar.laneFixture=true). The sample machines are linux-box (unfolded), build-mac and gpu-box (offline).

Before (d24c284, base): no groups.

LightDark
lightdark

After (6bbe726): one cloud group per machine after App Store, with live counts. linux-box is unfolded with its chats; gpu-box is offline, dimmed and last.

LightDark
lightdark

Scale and timers

The peers hold about 1,450 sessions, so no row follows an event, and nothing runs while no lane changes (no idle wakeups).

  • laneWatch: an ObservationStream over the lane store. Each change only arms the one-shot DemandTimer refresh (scheduleIfIdle, 2 s). One rebuild then reads the lanes' state and title, and the result is published only when it differs. Stop: RemoteMachinesSidebar.stop() cancels the task and the timer.
  • peerRead: each gated rebuild asks the local daemon for _acpmux/peers unless a read is in flight. The call has a 2 s deadline. The daemon answers from memory and never asks a peer, so a slow or down machine can't stall it. A changed answer arms the same refresh timer. A peer that drops or reconnects changes lanes too: acpmux marks every row of a dropped peer stale and announces it, and a reconnect sends the peer's list. So its header follows without a periodic timer. Stop: one read per task, cancelled by stop(); a timer fire queued before stop() does nothing.

Not in this PR (follow-ups)

  • An "Older" row for closed and archived chats, capped and paged.
  • agent.openSessionTab --host <peer> (today hostRefusal refuses any host but this Mac and chief:).

Testing

  • RemoteMachinesSidebarTests covers grouping per peer, recency order, offline peers, folded headers with the cloud icon and count, paging, the fold and page clicks, placement after the top items, and parsing _acpmux/peers.
  • Fleet run at b6d1b78 (package-test-lane.sh suite): RemoteMachinesSidebarTests 9/9 and ChiefSidebarItemTests 8/8 passed; the app and its tests compiled. check-concurrency, check-crash-safety, check-l10n and the fixture host-name check pass locally.
  • Captures use the Debug tunable sidebar.laneFixture (sample machines, above), because capture minis run no peers.

Localization: two new keys (sidebar.remoteMachines.offline, sidebar.remoteMachines.showMore) in all 9 macOS locales plus the catalog's other locales. localize-changes shows the parity baseline unchanged.

Risk: normal. The change is additive client-only sidebar rows: the layout document, the row views and the workspace mapping are untouched. The main risk is the top band getting taller when several groups are unfolded. Groups fold by default and page 10 rows at a time to limit that.

Changelog

Added: the sidebar shows agent chats running on your other machines, one group per machine, with an offline state.

Agent session: cosmic-gray

🤖 Generated with Claude Code