Repository navigation
Agent pane: checkpoints and cloud recovery read the link state, not the last emit's reason - #32044
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-2f629b93d5a20c58e6f8
|
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)
Gallery before/after for
States
Pick other states with a Shipped in:
The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/41425819578 at f22cb91 failed: cmux-next checks (god files, concurrency, crash safety, l10n). |
…he last emit's reason
snapshot.connection names why the client emitted, not whether the link is
up. Checkpoints and cloud chat recovery compared it with "connected", so any
later emit ("session changed", a streamed event's kind) read as offline.
Both now use one linkUp() helper, the derivation the footer's `connected`
already used.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-2f629b93d5a20c58e6f8
|
Review (subagent claude-opus-5-5 medium): SHIP at 0c7b68e Checked every Follow-ups: [follow-up] recovery narrows for a cloud chat whose open fails on an open socket ("failed", 0 rows, no |
…me card Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-2f629b93d5a20c58e6f8
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
…oud recovery direct.ts emits "failed" when an open fails while the socket stays open, with no rows and no `unavailable` (set only while no chat is selected). The link is up, but the chat was never read, so recovery reads its machine as before #32044's linkUp change; checkpoints keep plain linkUp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-2f629b93d5a20c58e6f8
|
Review (subagent claude-opus-5-5 medium): SHIP at 93ebdfe Visual verdict: unchanged by this diff. Delta review from 0c7b68e: the only changes are the new link-state test and the one-line recovery input ( Follow-ups: [follow-up] after a "failed" emit with 0 rows, a later emit that counts as link up (for example "session changed" or "commands") turns recovery inactive again. |
Cause
snapshot.connectionnames why the client emitted a snapshot ("connected", "session changed", a streamed event's kind, "history", ...), not whether the link to acpmux is up (newtab/chatStore.tssays so). Two sites inApp.tsxreadsnapshot.connection === "connected"as "the link is up":online(useCheckpoints): any later emit calledsetOnline(false), which marks checkpoints unsupported and tells the apppane.checkpointAvailability: false;cloudChatRecoveryActive'sconnectedargument: any later emit counted as a lost link.#31983 made this the usual case: "session changed" now arrives right after a local chat opens, so checkpoints read offline just after a local chat opens.
Fix
A new helper,
linkUp(connection)inmodel.ts, holds the derivation the footer'sconnectedalready used (up unlessdisconnectedorconnecting…).connectedis nowlinkUp(snapshot.connection), declared beforeuseCheckpoints, and both checkpoints and cloud recovery read it. Cloud recovery also stays active on a"failed"emit (connected && snapshot.connection !== "failed"). direct.ts emits "failed" when a chat's open fails while the socket stays open. That snapshot has no rows and nounavailable, which is set only while no chat is selected. The link is up, but the chat was never read, so a paused Cloud machine must still get its Resume card, as it did before. Checkpoints keep plainlinkUp.I found no other
=== "connected"inwebviews/srcthat reads the agent pane's link state; the Cloud page'sconnectionis its own real link state.direct.tsis unchanged.Test
webviews/test/agent-pane-link-state.test.tsxmountsAcpmuxAppon a stand-in for the app's bridge, withgit.capabilitiesserving checkpoints. It sends a later emit for the same chat and checks the pane's lastpane.checkpointAvailability. With "session changed", "agent_message_chunk" or "history" it must staytrue. With "disconnected" it must gofalse, which is the control. There is also a unit check oflinkUp.cmux-ci test -- bash -c 'cd webviews && bun test test/agent-pane-link-state.test.tsx'false; the disconnect control passes.linkUpalone) it fails (run 41419434333, job 29ffbc9f149f4730881ea29ac1809cc7), and in the same job it passes with base's App.tsx. At 93ebdfe it passes:agent-pane-link-state.test.tsx6 pass,cloud-chat-recovery.test.ts6 pass,cloud-chat-resume.test.tsx10 pass (run 41420395649, job 42122f567d8946a5ac94d0715eabf1da).cloud-chat-recovery.test.ts(6),cloud-chat-resume.test.tsx(10), and everygit grep -l checkpoint webviews/testfile (16 files, 0 fail).tsc --noEmitin the same job reported one error, intest/latency/probe.ts(PerformanceEventTiming.interactionId). This PR does not touch that file.Changelog
Fixed: checkpoints no longer show as offline or unsupported just after a local chat opens, and a Cloud chat's recovery no longer treats an ordinary update as a lost connection.
Agent session: agent session
🤖 Generated with Claude Code