Repository navigation
fix(ssh): a reconnected transport starts managed orcad itself instead of inheriting a dropped start - #25689
Merged
OrcaWin merged 4 commits intoOct 6, 2026
Conversation
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — this is the first pullfrog review, covering the full PR.
- Shared an in-flight or recent serving check only on the same SSH transport (
connectionidentity + connect generation + remote port), so a reconnected transport runs its own check instead of inheriting the dropped start's failure asunverifiable. - Made a wake on a reconnected transport settle the prior same-host wake first, and claim its owner token before the on-host write, so a fence its own dropped wake left can be proven and released.
- Restricted
releaseOwnInterruptedWakeFenceto a fence whose owner file is present and matches this process's token; a fence with no owner file is never claimed. - Added unit coverage that a reconnected caller runs its own start, and that a fence with no owner token is refused.
- Extended the idle-exit e2e to assert the relaunch connect carries no
servingnote.
The wake path was traced end to end: the runningWakes await is a linear, bounded chain (no cycle), settle()'s token-equality guard prevents one wake from clearing another's token, and the require owner present + match change is equivalent to the pre-PR base behavior when the owner write is lost (base claimed the token after the write, so it could not release either). Both changed unit suites pass (21 tests).
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
added 4 commits
October 5, 2026 17:27
… inheriting a dropped one The serving check deduplicated in-flight starts by environment only. When a connect dropped mid-start (as when the launch-time auto-connect is replaced by a reconnect), the caller on the new transport joined the start bound to the dead one, got its failure, and reported the host managed with no server running. In-flight checks now join only on the same connection, connect generation and port, and a wake's own fence token is cleared only by that wake.
… at any point The flake's real verdict was 'fenced': the dropped launch-time wake held the activation fence, and the reconnected wake could not prove it its own. A wake now claims its token before its first remote step, an absent owner record under a held token is still its own, and a reconnected wake waits for this client's dropped wake to settle before reading the fence.
A fence with no owner file could be another client's fresh one. Releasing it now requires the owner token this process wrote; the token is claimed before the write so a drop after it still proves ownership.
OrcaWin
force-pushed
the
OrcaWin/node-rt-p3-idle-relaunch-race
branch
from
October 6, 2026 00:33
c1b0d65 to
7ff2191
Compare
7 of 9 tasks
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.

ELI5
When Orca restarts a server it manages on an SSH host, and the SSH connection drops partway through, the next connection could report the server as running even though it wasn't. Every action on that host then failed. Now the new connection starts the server itself instead of reusing the failed attempt's answer.
What Changed
Before: the client starts a stopped managed server whenever it connects (#25121). To avoid starting it twice when two callers ask at the same moment, it shared one in-progress start per server. Here is the failure case:
This is the flake in
ssh-orcad-idle-exit.spec.ts:50: the connect returnedkind: 'managed', and the host had no orcad process.After: a caller only shares an in-progress start that runs on the same SSH connection, connect generation and port. That is the same rule the short-lived "server is up" cache already followed. A caller on a reconnected transport runs its own check. It probes the server, proves the old process is gone, takes over the fence its own interrupted start left behind (#25470 added that), and launches the server. The wake's in-memory record of its own fence is now cleared only by the wake that wrote it, so a late failure on the dead connection can't erase the newer wake's record.
Why
A fence is released only if its owner file carries this process's own token. A fence with no owner file is never claimed, because it could be another client's fresh fence that hasn't written its owner file yet. A test covers that case.
Linked Issue
Fixes # (Phase 3 follow-up; e2e flake on #25602 and #25405)
Visual Proof
N/A. No UI change.
Testing
New unit test in
orcad-managed-serving.test.ts. A start is in progress on one connection. The connection's generation changes, which models a reconnect, and a new caller arrives. The old start then fails with "SSH connection lost". The new caller must run its own start and getstarted. Without the fix, it inheritsunverifiableand the test fails; I ran it against the reverted code to confirm.The e2e spec now also asserts that the relaunch connect carries no
servingnote, so if this regresses the failure names the cause.Local: the orcad and SSH host-server unit suites pass (14 files, 169 tests). Typecheck and the changed-code quality gate pass.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
The SSH case is the subject of this change. The fix is not platform specific, so Windows hosts follow the same path. No wire changes.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)