Repository navigation
cmux-tui: agent-session-adopt binds another chat of this machine to an agent tab (1/3 of #22871) - #24554
cmux-tui: agent-session-adopt binds another chat of this machine to an agent tab (1/3 of #22871)#24554teamleaderleo wants to merge 4 commits into
Conversation
…pmux to an agent tab Split out of #22871 (the daemon half). agent-session-adopt {surface, session} (agent-session-adopt-v1) binds a session of this machine's own acpmux to an unbound agent tab of this store, with agent-session-start's gates (a trusted local non-remote client, the host gate that refuses team VMs and unverified Cloud VMs, a tab of this store with no session yet). It refuses with agent_session.unknown_session any id this machine's _acpmux/sessions does not list as its own (a peer's mirror, the Home Chief's, an unknown id), and answers {surface, session, conversation, family, mode, asking}. A new agent-session-mode verb reads a bound tab's mode; the attach reply carries it, and an attachment with mode_events hears agent-session-mode pushes when it changes (one read at a time, released with an AcqRel swap so a change during a read is never lost). is_chief moves to agent_session_start and is shared with agent_update. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a16040-fd0b-7dd0-9487-1a3a198d9f5c&host=cosmic-gray
|
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)
red: cmux-next checks (god files, concurrency, crash safety, l10n); NEW: |
|
Owned by p0-machines on air-blue · session |
|
Found 11 test failures on Blacksmith runners: Failures
...and 1 more test failures. View all on Blacksmith
|
|
Fleet at head
|
|
Bead |
…nscript kinds, and a record's full name Review (codex xhigh) at fcd4f27: a re-attach on the same connection left out agentMode; mode_events missed current_mode_update when the attach's kinds were transcript plus config_option_update (acpmux filters it out of transcript); agent-session-mode refused a tab whose record holds the chat's full name. The re-attach reads the mode as the first attach does. An attach with mode_events subscribes to the mode record kinds its kinds leave out and keeps them out of the client's page and stream. Mode facts are read for the record's value (an id, or a full name acpmux lists for the resolved id) and keyed by it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a16040-fd0b-7dd0-9487-1a3a198d9f5c&host=cosmic-gray
… their own PR The adopt verb alone stays here; agent-session-mode, the attach reply's agentMode and the mode_events pushes land in a PR stacked on this one, so each stays under about 800 changed lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a16040-fd0b-7dd0-9487-1a3a198d9f5c&host=cosmic-gray
An app that sees the capability sends mode_events and agent-session-mode, which this PR does not serve yet; the stacked mode PR advertises it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a16040-fd0b-7dd0-9487-1a3a198d9f5c&host=cosmic-gray
|
Review (codex xhigh, correctness first): SHIP at d07af2f No blocking findings. Checked:
Reviewer: Codex xhigh (acpmux session Fleet at this head
|
|
Closing: feat-cmux-next now reaches this PR's goal another way, so this verb would land with nothing to call it. #22871's goal was to show a chat running on another machine (cmux16, huge-blue) in this Mac's sidebar and open it. Base does that through acpmux peer mirroring, with the tab bound on this Mac:
The Agent session: Air-Blue |
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
HOLD: sidebar change under Lawrence's sidebar hold; open for dogfooding, never ready-to-land.
Split out of #22871, part 1 of 4 (the adopt verb). #22871's intent: "Open a chat that already runs on another machine (cmux16, huge-blue; for example one
cmux agent open huge-blue/NAMEstarted) as a sidebar workspace bound to that machine's daemon." Stack: this PR, then #24559 (mode reads), then #24555 (bypass badge), then #24556 (the app's adopt workspace).Summary
agent-session-adopt {surface, session}binds a session of this machine's own acpmux to an unbound agent tab of this store.agent-session-start: a trusted local non-remote client, the host gate that refuses team VMs and unverified Cloud VMs, and a tab of this store with no session yet.agent_session.unknown_sessionany id that this machine's_acpmux/sessionsdoes not list as its own: a peer's mirrored chat, the Home Chief's, or an unknown id. It never starts acpmux.{surface, session, conversation, family, mode, asking}.asking: falseso the app can warn.is_chiefmoves toagent_session_startand is shared withagent_update, using base's panic-freeJsonFields::field.agent-session-adopt-v1goes intoidentifyin cmux-tui: agent-session-mode and the attach mode reads for adopted chats #24559, together with the mode reads. An app that sees the capability sendsmode_eventsandagent-session-mode, which this PR does not serve, so this PR alone is dark.fcd4f27found three issues in the mode reads. They are fixed with CLI tests in cmux-tui: agent-session-mode and the attach mode reads for adopted chats #24559, which now holds that code, so each PR stays under about 800 lines.Risk: high. This adds a socket verb that binds sessions and lets a non-asking session open on a trusted host.
Changelog
none (the app half, #24556, carries the user-visible line)
Observed / Not run
Fleet runs at this head are listed in the comments below with their job ids.
Base red, not this PR's:
cmux-tui::cli agent_session_start::*(for examplea_peer_session_makes_the_keyed_restart_unsafe) fails under load with "acpmux did not answer in time" (agent_session.timeout). Basee1429af1bbc4with the same--arg test --arg agent_sessionstep is red the same way (step38542d4ae54759f6fd6129a0). The narroweragent_session_startrun is green on #22871's head (stepa4dcf8dcc08856d309bd0f8b, 34/34).Not run: no live adopt of a real remote chat end to end.
🤖 Generated with Claude Code
Agent session: cosmic-gray