Repository navigation
fix(managed-server): let the update candidate name the daemon generations an old host cannot - #34908
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 3 minutes. View limit details
No actionable comments were generated in the recent review.
|
500b440 to
f383c75
Compare
…ions an old host cannot Hosts that predate the census protocol set report a null protocol whenever terminals span daemon generations, so a forced update stayed refused there even though the incoming build could reach every daemon. When the census cannot answer, the candidate's profile preflight now lists the daemon generations alive under the data root the server serves, passed to it explicitly, and the planner checks attachability against that list. An uncounted census still refuses, and any generation the probe cannot rule in or out leaves the update unverifiable.
f383c75 to
d6c2df2
Compare
ELI5
#34664 lets a host report every terminal daemon generation it runs, so a forced update can go ahead when the new build can reach them all. A host still running an older Orca server can't report that yet. It keeps answering "unknown", so the update that would bring it the fix stays refused. This PR has the new build answer for it: before anything stops, the new build looks at the host's daemon directory and lists the generations it finds alive, and Orca checks that list.
Follows #34664.
What Changed
planOrcadUpdate/assessOrcadLiveDaemonCrossingtake the daemon generations the candidate observed on the host. They use that list only when the census has a session count but can name no protocol, which is exactly what an older host reports for mixed generations. When the census itself names a set or a scalar, that answer wins. An uncounted census stays unverifiable, because it could hide in-process terminals.--orcad-profile-state-preflight <nonce> <userDataDir>). The preflight had been resolving its own data root, either the default~/.orcaor the XDG one, rather than theORCA_USER_DATAthe server runs with (for example a shared-home machine root). Without the explicit argument it would have checked the wrong daemons.listLiveDaemonProtocols(src/main/daemon/daemon-generation-liveness.ts):daemon-v<N>.pidit finds, using the same socket paths the serving process and its legacy discovery use.daemon-newer-protocol-hold.ts, which now reuses it unchanged.Why
The incoming build is the code that will attach the daemons after the restart. So its own discovery is the right authority on whether it can reach them, rather than an old server's census or a manual override. Every other case keeps today's behaviour. Older candidates never see the extra argument: the candidate is always this desktop's own build, and the startup preflight still takes exactly one argument.
Linked Issue
No GitHub issue; reported directly by the maintainer (managed host "omarchy": 80 live terminals across two daemon generations,
orcad_update_daemon_protocol_unverifiableeven with--force).Visual Proof
N/A: update-planning and host-probe change with no UI change.
Testing
orcad-update-admission-fence: a forced update on an old-census host with mixed generations activates when the candidate attaches every generation it reports, and stops nothing when one is unattachable. The served data root is the one probed. Fails on main without this change.orcad-update-plan: the host list is trusted only for a counted census that can't name its generations.daemon-generation-liveness(real sockets): finds every answering generation, including one newer than the build and one with an unreadable pid record; an unlistable directory gives null.pnpm check:changedand every test file importing a changed module.Review
Agent skill upstream boundary
Notes
Security: the probe is read-only (connect and close, and reads of pid records); it never deletes or signals. Cross-platform: uses the existing socket-path and named-pipe resolution; the Windows command line passes the data root through the existing PowerShell quoting. SSH/WSL: both go through this activation. Mobile: not affected.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)