Repository navigation
cmux-next: a fresh CLI or MCP call without a kind keeps the Chief owner from restarting - #25513
Merged
Merged
Conversation
…ief owner restart (red) The DEV keyless Chief owner restart (e859e33) probes the owner with OwnerIdleProbe, which counts a fresh local client that names no kind as idle. A `cmux` CLI or MCP call names no kind, so the owner restarts in the middle of its request. This test opens such a call and expects the restart to wait while it is connected and to run after it ends. It fails on this commit: attempt() returns .started. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-1288bbb2b5d2f5c6b66a
…f owner busy The DEV keyless Chief owner restart (e859e33, c6390e5, 79ce2f2) asked OwnerIdleProbe whether the owner is idle, and the probe let every local client without a kind through. A `cmux` CLI or MCP call names no kind, so IdleOwnerRestart could restart the owner in the middle of its request. As in 4f7d43f (the quiet restart's fix on the closed #23199 branch), a local client without a kind now holds the restart while it is younger than callSeconds (a minute). An older one is a standing connection: the daemon's own agent screen detector holds two for its whole life and must not hold the restart forever. Such a client stops counting as a call without any owner event, so when the probe sees only calls in flight it answers callInFlight(seconds:) and IdleOwnerRestart schedules one more attempt for then (a one-shot DemandTimer, cancelled when the outcome is decided and with the actor). A call that ends sooner sends client-detached, which probes again as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-1288bbb2b5d2f5c6b66a
Collaborator
Author
|
Owned by hb-acpmux on big-red · session |
Collaborator
Author
|
Bead |
…ner before it shuts down Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-1288bbb2b5d2f5c6b66a
|
Found 8 test failures on Blacksmith runners: Failures
|
Contributor
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) red: cmux-next checks (god files, concurrency, crash safety, l10n); no finished base run on c743a34 to compare; do not merge until green; see lane-rules |
Collaborator
Author
|
|
teamleaderleo
marked this pull request as ready for review
October 26, 2026 16:48
teamleaderleo
temporarily deployed
to
ci-routing-agent
October 26, 2026 16:48 — with
GitHub Actions
Inactive
Contributor
|
Shipped in:
|
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
OwnerIdleProbecounted a freshcmuxCLI or MCP connection, one that has not sent a client kind, as idle. Its only caller is the DEV keyless Chief owner restart (ChiefConversationOwner+InstallKey.swift:25, from e859e33 by @lawrencecchen, with c6390e5 and 79ce2f2). SoIdleOwnerRestartcould restart the Chief owner while one of those connections was in the middle of a request.Fix
OwnerIdleProbe: a local client that names no kind and connected less thancallSecondsago (a minute) counts as a call in flight, so the owner is busy. This is the rule 4f7d43f used for the quiet-restart path (closed cmux-next: local acpmux and cmux-tui move to the bundled build by themselves #23199 branch). An older kindless client is treated as a standing connection, because the daemon's own agent screen detector keeps two kindless connections open for its whole life and they must not block the restart forever. A newreading()returns.idle,.busy, or.callInFlight(seconds:).isIdle()still exists.IdleOwnerRestart: when a kindless client crosses thecallSecondsline, the owner sends no event. So on.callInFlightthe restart sets a one-shotDemandTimerto try once more at that point. If the call ends sooner, itsclient-detachedevent triggers a new probe, as before.scheduleIfIdle, never repeats), and a fired attempt only reschedules if the probe still sees a call in flight.DemandTimer.deinit). It holds the actor weakly.Risk: low. This only affects the DEV keyless Chief owner restart, which becomes more conservative. An owner younger than a minute now waits up to about a minute before it restarts (the detector's connections are young then), where before it restarted immediately.
Test
OwnerRestartWaitsForChatTests.theRestartWaitsWhileACLICallWithoutAKindIsConnected(live daemon): it opens a second connection, clears its kind the way a CLI call has none, and checks thatattempt()returns.waitingwith the owner pid unchanged. It then closes the call and expects the restart to run.firstOutcomenow also returns when the restart's own timer decides the outcome, and the timeout is 90 s for a fresh owner.Fleet results (
cmux-ci run ... package-test-lane.sh suite Packages/macOS/CmuxNext OwnerRestartWaitsForChatTests)4d2b80aa80caafa937909ebcon cmux12s-Mac-mini:551e8af6334ad7e1691a860con aws-m4pro-3:expectNewOwner).cmux-ci compile-check --apppassed at 7bec44f (job76a0ab9a59c699fda0235b32).No capture: no UI changes. This is the daemon connection layer (CmuxNextDaemon idle probe and restart actor) plus a live-daemon test; nothing is drawn differently.
Credit: e859e33 (@lawrencecchen) built the idle-gated keyless owner restart; this closes the CLI/MCP-call gap in its probe.
Agent session: big-red
🤖 Generated with Claude Code