composer: list every machine acpmux knows in the environment picker
Leo's words: "and why dont i see that the acpmux things are there? how is our setup flow anyways? like cmux-next remote and whatnot"
The machine chip's list ("Search environments") now shows every machine the local acpmux daemon knows. The source is the daemon's own host list: _acpmux/status peers, the same hub.peers() that acpmux host ls prints. There is no app registry. The machines are grouped as This Mac / My machines / Cloud and VMs. Inside each group, the machines a chat can start on come first, in number order (lane-2 before lane-10). Machines that are reconnecting, connecting (degraded, handshake not done) or offline stay listed, greyed, with their state in words, and can't be picked. The list stays searchable by name, group and kind, so 20+ rows stay usable. While the list is open it re-reads the daemon every 5 s, so a machine that connects or drops shows without reopening.
Where the list was cut to one row
- New Tab page (
newtab/NewTabScreen.tsx, itsComposerContext): it passedsessions={localSessions}(this Mac's chats only) and nopeers.availableComputerstherefore produced exactly one row, this Mac. That is the reported "Search environments" with only the Mac's own name. The page now passes the daemon'speers,peerKinds,peerConnectedandpeerStates. A pick starts the chat on that machine through the existingchat.new {peer}path (the one saved SSH environments already use). - Chat composer with previews off (
ComposerContext.tsx): peers were listed, but their transport and status were dropped (environments ? peerKinds : NO_PEER_KINDS). Every peer read as "Cloud" with no state. The plain Computer menu now gets the same groups, order and greying. - No state anywhere: the relay already passes each peer's
state(AcpmuxPaneMethods.replyShapes), but the page only keptconnected. It now keepsstate(direct.ts→AcpmuxSnapshot.peerStates).
Picking
- New chat (chat composer): picking a connected machine whose folder is known calls
onProject(folder, peer)as before. Picking one with no known folder callschat.new {peer}, the existing start-on-a-peer flow. Before, this pick did nothing. - New Tab: the chat starts on the picked machine. Picking a folder on this Mac, or a saved environment, clears that machine.
- Greyed rows: greyed rows refuse a click, Return and ⌥⌘digit, and the list stays open. ⌥⌘1–9 number only the machines a chat can start on.
- Start details: a chat started on another machine with no folder known starts in that machine's default folder; it no longer inherits this tab's local path (
newSessionHostindirect.ts). It starts on the model the page showed (_meta.acpmux.model, which acpmux reads asmodel_request). After a remote pick the prompt takes focus back. A New Worktree reply that arrives after a machine pick no longer takes the chat back to this Mac. - Stale peers: a chat's machine the daemon no longer lists is shown as not connected and can't be picked.
Moving an already started chat is not part of this PR. It was left to the chip-menu PR, which review found unreachable for started chats (see below).
Before / after
No capture host has acpmux peers: capture slots run the app against an isolated acpmux home. So these are gallery renders with a realistic 21-machine fixture, built from the shape of a real host ls: four machines of the person's own (one offline), two numbered VM pools (three reconnecting, one in its handshake) and a cmux Cloud machine. Both sides render the same fixture (base components, head components), Chromium, Linux.
| Before (base) | After | |
|---|---|---|
| New Tab machine chip (the reported one-row list) | ![]() | ![]() |
| Environment picker, previews on | ![]() | ![]() |
| Plain Computer menu, previews off | ![]() | ![]() |
Tests
test/environment-picker.test.tsxcovers:- the daemon host list mapped to groups, order and state (
knownMachines+orderEnvironments, 21 machines); peerStatesFromStatuson the relayed and the raw reply;- the picker listing all of them, grouped, with greyed rows saying their state and refusing picks;
- a connected pick moving the new chat;
- search at 21 rows;
- the plain Computer menu matching;
- the open list's refresh timer starting on open and stopping on close;
- a numbered pair vs a pool;
- a stale chat peer;
- a late worktree reply after a machine pick (fails without the fix).
- the daemon host list mapped to groups, order and state (
test/new-tab-saved-environments.test.tsxcovers:- picking a daemon machine on New Tab starts the chat there (
chat.new {peer}, no local folder check) and focuses the prompt; - this Mac again starts it here;
- a machine after a saved environment;
- the model goes with a peer start;
- a peer start with no folder does not take this tab's folder.
- picking a daemon machine on New Tab starts the chat there (
- Linux CI (bun):
- Both files: 50/50.
- Typecheck, lint (0 warnings) and format are clean.
- The related New Tab/composer set: 11 failures, the identical 11 failing on base.
- The gallery coverage suite: 3 failures, identical on base.
- Full webviews suite: every file with a failure at this head was rerun alone on head and on base, with identical per-file counts (Playwright glass/scroll suites).
Review
Codex (gpt-6-astra, xhigh), six rounds:
- Round 1 BLOCK: the model was dropped on remote starts; stale peers showed as ready; a numbered pair was grouped as a pool. All fixed.
- Round 2 BLOCK: the prompt focus after a remote pick. Fixed.
- Round 3 BLOCK: a late worktree reply over a machine pick. Fixed.
- Round 4 BLOCK: the inherited local cwd on a folderless peer start, fixed. Its other finding was a misread: the Computer menu is the
LocationPickercombobox, notMenuRadioItem. - Round 5 BLOCK: both findings were already handled. The picker clears a saved environment first, and the main composer already refreshes machines. A guard and a test were added anyway.
- Round 6: SHIP at the final head.
Size: +777/-88, a little over the ~800-line guide. About 380 lines are tests and the shared 21-machine gallery fixture. The source change is one feature (list source, grouping, order, state and picking) that doesn't land usefully in halves.
Risk
This is a webview-only change. It touches no daemon or Swift code. The 5 s refresh only runs while a machine list is open (useMachineRefresh: it stops when the list closes or the picker unmounts). Each refresh is one _acpmux/status read, the same request the list already made when it opened. The pool grouping is read from names: an SSH peer counts as a pool only when three or more peers share a name stem and a number (so build-mini-1/build-mini-2 stay in My machines). Any other SSH peer is in My machines.
Gallery: agent-pane.new-tab/machines-fleet, agent-pane.composer-context/environment-picker-fleet, agent-pane.composer-context/computer-menu-fleet
Agent session: agent session
🤖 Generated with Claude Code





