fix(cli): elect one managed daemon#35826
Closed
kitlangton wants to merge 2 commits into
Closed
Conversation
kitlangton
force-pushed
the
daemon-election
branch
2 times, most recently
from
July 8, 2026 14:28
5f52301 to
95c83a1
Compare
kitlangton
force-pushed
the
daemon-election
branch
from
July 8, 2026 14:55
95c83a1 to
c61e93a
Compare
This was referenced Jul 8, 2026
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.
Addresses #35801
Prerequisite for #35646.
Summary
EffectFlock.tryAcquirewith scoped release and heartbeatWhy
Service registration currently happens after route construction, so concurrent starts can create several live daemons before registration eventually selects one. Session restart recovery needs a real single-owner daemon seam before it can safely start work.
The registration file remains client discovery. The lifetime lock establishes which process may construct and serve the managed daemon.
Verification
serve --servicecandidates and verifies one registered healthy owner remainsbun typecheckinpackages/coreandpackages/cliFollow-up
A separate recovery-inbox change can now start only from the elected daemon and avoid scanning historical Session events.
packages/cli/src/tui.ts.