Repository navigation
cmux NEXT daemon update: Cloud machines follow the app's build - #25396
Conversation
|
Owned by hb-acpmux on big-red · session |
This comment has been minimized.
This comment has been minimized.
|
Bead |
|
|
ce50273 to
a586eeb
Compare
|
|
a586eeb to
748a486
Compare
|
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); no finished base run on 3660113 to compare; do not merge until green; see lane-rules |
7eb28df to
18c208d
Compare
18c208d to
a2c4cc5
Compare
1201f4d to
f6c07ef
Compare
Each handshake of a Cloud machine's daemon (the first connect, every reconnect, and one the app refused) offers the machine to the shared daemon update queue (CloudMachineUpdates). After `cmux link machine update` the machine connects again (CloudMachineSession.reconnectAfterUpdate); an app-server link's socket is read without handing it to a connection (CloudLinkSession.currentSocket), so a refused daemon can be updated. The machine header shows the update's line while it runs or retries, and a failure until the machine runs the build it was to. Timers: the handshake follower is one observation task for the app's lifetime; each offer is one task that ends once the queue took the machine. From #24070 (daemon-peer-update bd4892c). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…also before the old drop, and a skipped handshake stays due Review fixes on the Cloud follower: - After an update that may have restarted the daemon, an app link drops the current connect's ticket and connects afresh (after a hop in flight): the old connection's drop can reach the app after the CLI answered, and its endpoint call is then an old ticket's and changes nothing. An update that restarted nothing leaves a healthy connection. - A handshake is spent only by an offer that was made: one seen while the toggles are off, or with no cmux client, is offered once they allow it (the follower also observes the toggles). A machine with no handshake forgets its last, so a second refusal after a drop is new. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The policy may drop a machine it queued while the toggles are off, so a handshake offered before stayed spent and was never offered again once they turned on. Turning them off now forgets every offer: turned on again, each live handshake is offered once more. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
f6c07ef to
4381e75
Compare
|
Found 8 test failures on Blacksmith runners: Failures
|
|
|
|
Shipped in:
|
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Part 10 of the rebuild of #23199 and #24070, the last (adopted by hb-acpmux). On feat-cmux-next. #25393, #25394 and #25395 below it landed (c743a34, 30f84dd, 3660113), and this branch is rebased onto them: head 4381e75, the same patch-ids as the reviewed e9e2fa2 (+513 −6).
Cloud machines now follow the app's build by themselves, also while an agent works there (no wait for idle), and the header shows the update.
Leo: "BRO CANT YOU JUST LIKE SUSPEND SHIT AFTER A TOOL CALL/TURN THEN JUST GO AND AUTOUPDATE OUR TEAMMATES NEED ACPMUX UPDATING TOO..."
Leo: "OUR SHIT IS HARDLY EVER GOING TO GO IDLE. IT JUST WONT. YOU'LL JUST HAVE TO ACCEPT IT BREAKING AT SOME POINT BUT IT RESUMES WHATEVER IT INTERRUPTED. END OF STORY FOR THE DAEMON UPDATE."
Leo-ask: ask-48bbaec1d4
Leo-ask: ask-061e3574a6
Change
From #24070 at bd4892c:
CloudMachineUpdates.start(fromAppServices.startCloud): every new handshake of a Cloud machine's daemon (first connect, reconnect, or one the app refused) offers the machine to the shared queue, behindcloud.updateMachinesandagent.updatePeers.HandshakeFollowerspends a handshake only on an offer that was made. One seen while the toggles are off, or before the app has acmuxclient, is offered once they allow it; the follower observes the toggles too. A machine with no handshake forgets its last, so a second refusal after a drop is new.CloudMachineSession.reconnectAfterUpdate(restarted:): after an update that may have restarted the daemon, the machine connects afresh. A legacy link's waiting connect is woken. An app link drops the current connect's ticket and connects again, after any connect already in flight. This holds also while the app still holds the old daemon's connection, whose drop can arrive after the CLI answered: that late drop is then an old ticket's and changes nothing. An update that restarted nothing leaves a healthy connection alone.CloudLinkSession.currentSocket: the app link's socket without handing it to a connection, so a refused daemon on an app-server link can be updated (old review fix a187752).CloudCreationRows.withUpdate: the header shows the update's line while it runs or retries; a failure stays until the machine runs the build it was to (old review fix e6ff99d).Timers and their stop conditions
ObservationStreamtask): app lifetime; it does no work between handshakes.Tests
aRefusedDaemonOnAnAppLinkIsUpdatedAndConnectedAgain(CloudMachineUpdateAppLinkTests: a realCloudMachineSessionon an app link, a stand-in daemon that answers an old protocol, a stand-incmux): the refused daemon is updated through the link's socket with--to-bundled, and the machine connects again with a fresh link.theHeaderShowsTheUpdateState: the line while it runs or retries; a failure stays while the machine runs another build, also one serving every capability, and goes once it runs the update's build.CloudMachineUpdateFollowTests: a refusal while off is offered once the toggles turn on; an offer not made stays due; a handshake after a drop is new; an offer is made again after the toggles go off and on; and the reconnect decision after an update, including the CLI answering before the old connection's drop.Review (Codex gpt-6-astra xhigh): the first round blocked on 2 P2s (a missed app-link reconnect when the CLI finishes before the old drop; refusals deduplicated for good). Both are fixed in 1c7615c. The second round found that turning the toggles off and on again could leave an offered machine unoffered; fixed in e9e2fa2 (turning them off forgets every offer). SHIP at e9e2fa2.
Red on base: these name
CloudMachineUpdatesandwithUpdate, which base doesn't have.Observed / Not run
cmux-ci compile-check --release --mac): arm64 passed (step 7e90c0f3cbda4e2334da4c6e, cmux7s-Mac-mini, 1042 s) and x86_64 passed (step 16473528fa5aa094a41c498e, aws-m4pro-7, 460 s). PR CI's app compile (build fleet) was green at 1201f4d: https://github.com/manaflow-ai/cmux/actions/runs/40348120303/job/121661437686CloudMachineUpdateTargetTests,CloudMachineUpdateAppLinkTestsandCloudMachineUpdateFollowTestspass.cmux-next swift testat 1201f4d: 26 reds. 24 are on the known base and flaky list. The other 2 pass when their suites (SharedIndicatorSurfacesTests,ChiefGroupChatActionsTests) run again on the fleet; this PR touches neither suite.No capture: the header line appears only during a real Cloud update; its text is
DaemonUpdateBoard.line(#25393).Agent session: big-red
🤖 Generated with Claude Code