Skip to content

fix(managed-server): let the update candidate name the daemon generations an old host cannot - #34908

Merged
nwparker merged 1 commit into
mainfrom
fix/orcad-candidate-daemon-generations
Oct 28, 2026
Merged

nwparker merged 1 commit into
mainfrom
fix/orcad-candidate-daemon-generations

Conversation

@nwparker

@nwparker nwparker commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​123 $\color{#cf222e}{\Huge{\mathbf{−}}}$​7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​116
Prod 12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​275 $\color{#cf222e}{\Huge{\mathbf{−}}}$​114 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​161

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 / assessOrcadLiveDaemonCrossing take 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.
  • When the census is in that state, activation runs the candidate's profile preflight before deciding to defer, and passes it the served data root as an explicit extra argument (--orcad-profile-state-preflight <nonce> <userDataDir>). The preflight had been resolving its own data root, either the default ~/.orca or the XDG one, rather than the ORCA_USER_DATA the server runs with (for example a shared-home machine root). Without the explicit argument it would have checked the wrong daemons.
  • New listLiveDaemonProtocols (src/main/daemon/daemon-generation-liveness.ts):
    • It probes every protocol this build knows plus every daemon-v<N>.pid it finds, using the same socket paths the serving process and its legacy discovery use.
    • An answering endpoint counts as live.
    • It returns null (unverifiable) if any generation can't be ruled in or out: a timed-out probe, a dead endpoint with a possibly-live process, or a directory it can't read.
    • The pid/endpoint classifier moved here from daemon-newer-protocol-hold.ts, which now reuses it unchanged.
  • Refusal messages no longer claim the unattachable daemon has live terminals; the host list can include idle daemons.

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_unverifiable even with --force).

Visual Proof

N/A: update-planning and host-probe change with no UI change.

Testing

  • Automated tests added/updated
  • 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.
  • Ran pnpm check:changed and every test file importing a changed module.
  • Not run: a Docker end-to-end of the exact {50,51} case. It needs an older released orcad, with an older daemon protocol, as the incumbent, which the Docker lane can't build. The Docker managed-orcad lane runs here for regressions.

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

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

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5be1f18f-4cbc-4ddf-b4a6-27cd888f51fe
Commits

Reviewing files that changed from the base of the PR and between 500b440 and d6c2df2.

Files selected for processing: 19
  • src/main/daemon/daemon-generation-liveness.test.ts
  • src/main/daemon/daemon-generation-liveness.ts
  • src/main/daemon/daemon-launch-paths.ts
  • src/main/daemon/daemon-newer-protocol-hold.ts
  • src/main/daemon/daemon-runtime-dir.ts
  • src/main/managed-server/activation/orcad-activation-crash-recovery.test.ts
  • src/main/managed-server/host-state/orcad-state-mutation-timeout.test.ts
  • src/main/managed-server/install/orcad-remote-preflight.ts
  • src/main/managed-server/posix-host-op-byte-budget.test.ts
  • src/main/orcad/main.ts
  • src/main/orcad/orcad-profile-preflight.ts
  • src/main/ssh/orcad-candidate-preflight.ts
  • src/main/ssh/orcad-daemon-protocol-crossing.ts
  • src/main/ssh/orcad-installed-activation.ts
  • src/main/ssh/orcad-snapshot-room.test.ts
  • src/main/ssh/orcad-update-admission-fence.test.ts
  • src/main/ssh/orcad-update-plan.test.ts
  • src/main/ssh/orcad-update-plan.ts
  • src/shared/orcad-profile-preflight.ts

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c75de13e-11cf-4a1d-8d9e-03003a3fc584
Commits

Reviewing files that changed from the base of the PR and between 0458c5d and 501b7ac.

Files selected for processing: 19
  • src/main/daemon/daemon-generation-liveness.test.ts
  • src/main/daemon/daemon-generation-liveness.ts
  • src/main/daemon/daemon-launch-paths.ts
  • src/main/daemon/daemon-newer-protocol-hold.ts
  • src/main/daemon/daemon-spawner.ts
  • src/main/managed-server/activation/orcad-activation-crash-recovery.test.ts
  • src/main/managed-server/host-state/orcad-state-mutation-timeout.test.ts
  • src/main/managed-server/install/orcad-remote-preflight.ts
  • src/main/managed-server/posix-host-op-byte-budget.test.ts
  • src/main/orcad/main.ts
  • src/main/orcad/orcad-profile-preflight.ts
  • src/main/ssh/orcad-candidate-preflight.ts
  • src/main/ssh/orcad-daemon-protocol-crossing.ts
  • src/main/ssh/orcad-installed-activation.ts
  • src/main/ssh/orcad-snapshot-room.test.ts
  • src/main/ssh/orcad-update-admission-fence.test.ts
  • src/main/ssh/orcad-update-plan.test.ts
  • src/main/ssh/orcad-update-plan.ts
  • src/shared/orcad-profile-preflight.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

Walkthrough

The changes add daemon-generation liveness discovery and expose live daemon protocols through profile preflight. Update planning can use those protocols when the terminal census does not identify daemon generations. Installed activation can request candidate preflight data, replan, and apply the same protocol-aware plan during the fenced-stop recount. Tests cover liveness outcomes, protocol compatibility, and activation or deferral for mixed daemon generations.

Priority: Normal

Merge Risk: Minimal · previous review 501b7

The investigated update paths show no merge-blocking defect. The exact mixed-generation Docker scenario remains untested.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 63.16% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: allowing the update candidate to report daemon generations that an older host cannot identify.
Description check Passed The description is detailed and covers the user impact, implementation, rationale, testing, limitations, security, cross-platform behavior, and checklist items. The direct maintainer report explains w…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is detailed and covers the user impact, implementation, rationale, testing, limitations, security, cross-platform behavior, and checklist items. The direct maintainer report explains why no GitHub issue is linked, and the unchecked full-suite commands are addressed by the reported targeted testing and CI coverage.

Full details: Docstring Coverage

Explanation

Docstring coverage is 63.16% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 19 functions across 19 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker force-pushed the fix/orcad-candidate-daemon-generations branch 5 times, most recently from 500b440 to f383c75 Compare October 28, 2026 12:06
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant