Repository navigation
cmux NEXT: a remote chat connects again (one attach at a time, no "too many attached agent tabs") - #29295
Conversation
cmux-tui reserves a tab's attach slot while the attach connects to acpmux and refuses a second attach of that tab on the connection meanwhile (agent_session.limit, "too many attached agent tabs"). Since #27755 the page asks its session list (_acpmux/watch) and its attach together, and the remote wire turns both into agent-session-attach on one connection, so a Cloud or SSH machine's chat never connected. The later attach now waits for the earlier one and is then a page of the live attachment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-aa0f0a21b40fda1441b8
|
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)
Shipped in:
|
|
Owned by an agent session · session |
|
Found 11 test failures on Blacksmith runners: Failures
...and 1 more test failures. View all on Blacksmith
|
|
Review (codex, router-review): SHIP at a4a0599 Reviewer: codex gpt-6-astra high, fast tier. Follow-ups: 2. Each lands as an issue in this repo that links this receipt; the lane that opened the PR fixes it forward. SHIP at a4a0599 Visual verdict: no images; Leo tries the build
Follow-ups:
|
…never sent (#29387) (#29388) The one-at-a-time attach queue (#29295) did not check for cancellation after the wait, so a cancelled attach was still sent once the earlier one answered, and it had already replaced the client's event handler. It now checks after the wait and sets the handler only when the attach goes out. Agent-Session: https://cmux.com/deeplink/agent?id=aid-aa0f0a21b40fda1441b8 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: cmux-bot[bot] <348531757+cmux-bot[bot]@users.noreply.github.com>
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
A remote agent chat (a Cloud machine, or one reached over SSH) never connected. Its tab showed
connecting: Error: too many attached agent tabsand an empty transcript, althoughcmux cloud start-sessionhad started the chat and Claude was running. This blocks the NEXT Cloud demo flow.Cause
state.reservedinserver/agent_session_attach.rs). It refuses a second attach of the same tab on the same connection while the first is still connecting, withagent_session.limit, whose message is "too many attached agent tabs"._acpmux/watch) and its chat attach (_acpmux/attach) at the same time.RemoteAcpmuxWireturns both intoagent-session-attachon oneAgentSessionAttachClientconnection, each in its own task. The second request always reaches the daemon while the first is still reserved. It is refused, and the page's connect fails.Fix
AgentSessionAttachClient.attachsends one attach at a time per client. A later attach waits for the earlier one to answer, then goes out and is answered as a page of the live attachment (the daemon's "already attached in the same mode" path). The fix is in the app, so it also works against the cmux-tui already deployed on existing machines. If the caller cancels, the call it is waiting on is cancelled too.Risk: a remote chat's list read now waits for one attach round trip after the chat's own attach. That costs one round trip on open, against a page that never opened before. Local chats do not use this client.
Tests
AgentSessionAttachClientConcurrencyTestsuses a fake daemon that holds each attach for 300 ms and refuses a second one withagent_session.limitmeanwhile, as cmux-tui does. Two attaches are asked together, and both must answer with no refusal. The test was run on the fleet, both on base with only the test added (expected red) and at this head (expected green), together with the existingAgentSessionAttachClientPresenceTestsandAgentSessionAttachClientObserverTests.🤖 Generated with Claude Code
Agent session: agent session