Repository navigation
fix(ssh): declare a wedged relay link lost, and stop reading silence as a verdict - #17817
Conversation
Greptile SummaryThe PR adds bounded inbound-liveness checks on both sides of the SSH relay and introduces a three-state native-dependency probe so unanswered probes do not trigger destructive repair work.
Confidence Score: 4/5The PR is not yet safe to merge because confirmed SSH probe failures can still be swallowed as an unverifiable dependency result. The native-dependency probe catches every execution rejection and continues through the non-missing launch path, even though confirmed exec refusals are distinguishable from timeout or unconfirmed channel termination. Files Needing Attention: src/main/ssh/ssh-relay-deploy.ts
|
| Filename | Overview |
|---|---|
| src/main/ssh/ssh-channel-multiplexer.ts | Removes saturation as a dead-link-check exemption while preserving read-pause and wake protections. |
| src/relay/dispatcher-client-lifecycle.ts | Adds keepalive-aware client silence tracking, wake rebasing, and transport-only cleanup. |
| src/relay/dispatcher-frame-codec.ts | Records inbound activity and marks clients that participate in the keepalive protocol. |
| src/main/ssh/ssh-relay-deploy.ts | Introduces three-state dependency probing and restricts repairs to explicit missing verdicts. |
| src/main/ssh/ssh-relay-exec-command.ts | Adds a stable typed code and classifier for SSH execution timeouts. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Application multiplexer] <-->|Framed SSH traffic| B[Relay dispatcher]
A --> C{Inbound traffic within timeout?}
C -->|No| D[Dispose transport and reconnect]
C -->|Yes| A
B --> E{Keepalive-capable client answering?}
E -->|No| F[Detach silent socket client]
E -->|Yes| B
G[Native dependency probe] --> H{Probe verdict}
H -->|Available| I[Launch relay]
H -->|Missing| J[Repair node_modules]
H -->|Unverifiable| I
Reviews (5): Last reviewed commit: "fix(relay): exempt the primary sink from..." | Re-trigger Greptile
| } catch (error) { | ||
| signal?.throwIfAborted() | ||
| return { available: false, missing: [...RELAY_NATIVE_DEP_NAMES] } | ||
| // Why: the probe shell always exits 0 and prints MISSING for a real load failure, so a throw | ||
| // only ever means the host never answered — a timed-out `require()` on a wedged dlopen, or a | ||
| // torn exec channel. Reading that as "every native dep is missing" sent a healthy install | ||
| // through an eight-minute npm install + rebuild that could not help, then round-tripped until | ||
| // the 15-minute deploy budget expired (#14830). | ||
| console.warn( | ||
| `[ssh-relay] Native-deps probe did not answer at ${remoteDir}: ${ | ||
| error instanceof Error ? error.message : String(error) | ||
| }` | ||
| ) | ||
| return { verdict: 'unverifiable', missing: [] } |
There was a problem hiding this comment.
Confirmed probe failures become silence
When the probe command returns a definitive failure such as a permission-related cd error, SSH exec refusal, or session-limit error, this catch classifies it as unverifiable. repairInstalledNativeDeps then follows the same branch as an available probe and continues toward launch, obscuring the actionable error and bypassing applicable retry handling; restrict this conversion to timeout or otherwise unconfirmed termination errors.
Knowledge Base Used: Relay protocol and transport
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (10)
🚧 Files skipped from review as they are similar to previous changes (10)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe SSH multiplexer now detects dead links during writer saturation and preserves links that receive inbound keepalives. Native dependency probes classify non-zero node exits and execution timeouts without triggering repair for unanswered hosts. The relay dispatcher tracks inbound frames, handles paused timer intervals, and closes eligible silent clients. New tests cover these liveness and probe scenarios. Merge Risk: 🟡 Moderate · up to This PR changes SSH liveness handling and native-dependency repair decisions, but the current code can still treat an unanswered dependency probe as permission to rewrite native dependencies and can allow a silent client to retain relay resources indefinitely; these issues may cause wasted repair cycles or leaked sessions, so merge should wait for correction or explicit owner acceptance. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation The native-dependency changes address Full details: Out of Scope Changes checkExplanation The native-dependency probe changes are in scope for Full details: Description checkExplanation The description is detailed and on-topic. It explains the problem, changes, rationale, linked issues, regression risks, testing evidence, and scope. It does not reproduce every template heading, but it provides the required substantive information. ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 4fa8ea97-6925-4675-96bf-873453ba02b5
📒 Files selected for processing (10)
src/main/ssh/ssh-channel-multiplexer-saturation-wedge.test.tssrc/main/ssh/ssh-channel-multiplexer.test.tssrc/main/ssh/ssh-channel-multiplexer.tssrc/main/ssh/ssh-relay-deploy.tssrc/main/ssh/ssh-relay-exec-command.tssrc/main/ssh/ssh-relay-native-deps-install.test.tssrc/relay/dispatcher-client-lifecycle.tssrc/relay/dispatcher-contract.tssrc/relay/dispatcher-frame-codec.tssrc/relay/dispatcher-silent-client-reaper.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.
| } catch { | ||
| return probe.includes('ORCA-NATIVE-DEPS-OK') | ||
| ? { verdict: 'available', missing: [] } | ||
| : { verdict: 'missing', missing: missingNativeDepsFromProbe(probe) } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Require the explicit missing marker before repair.
A bare MISSING response has no ORCA-NATIVE-DEPS-MISSING: marker. The POSIX and Windows probe commands emit this response when Node cannot start. missingNativeDepsFromProbe() converts unmarked output into both dependencies, so Line 771 routes an installed relay into repair without confirmation that either dependency is missing. Return unverifiable when output has neither the success token nor the missing marker. Add a test for bare MISSING.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 3c543f56-9b3f-4e50-be89-d3466a6ecb48
📒 Files selected for processing (4)
src/main/ssh/ssh-relay-deploy.tssrc/relay/dispatcher-client-lifecycle.tssrc/relay/dispatcher-contract.tssrc/relay/dispatcher-silent-client-reaper.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review.
There was a problem hiding this comment.
Important
The new reaper's sleep/wake rebase shares its TIMEOUT_MS boundary with the reap itself, so a ~16–20s host pause can falsely disconnect every client — the same "silence as a verdict" class this PR removes elsewhere. See the inline comment for the fix; the rest of the change is solid.
Reviewed changes
SshChannelMultiplexerdead-link check unblocked — removed thewriterSaturatedsuppression so a wedged uplink disposes in ~20s instead of parking forever, while a live peer's own keepalives still refresh the clock.- Relay inbound-liveness reaper —
RelayClient.lastReceivedAtis stamped per decoded frame and a 5s keepalive tick closes clients silent for 20s, freeing owner leases and paused PTYs. - Three-state native-deps probe —
available/missing/unverifiableso an unanswered probe never authorizesnpm install+ rebuild. - Typed exec timeout code —
SSH_EXEC_TIMEOUT_CODEreplaces message-text matching on the timeout path.
ℹ️ Nitpicks
isSshExecTimeout/SSH_EXEC_TIMEOUT_CODE(ssh-relay-exec-command.ts) are exported but never consumed; the one existing message-text discriminator,EXEC_TIMEOUT_MESSAGEinssh-remote-platform-detection.ts:17, is left matchingtimed out after \d+s$instead of migrating to the new code.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/relay/dispatcher-client-lifecycle.ts (1)
178-178: 🩺 Stability & Availability | 🟠 MajorUse a wake-gap margin below
TIMEOUT_MS.A timer gap can be shorter than
TIMEOUT_MSwhilelastReceivedAtis already oneKEEPALIVE_SEND_MSinterval old. The next tick can then satisfynow - client.lastReceivedAt > TIMEOUT_MSand close a healthy client after a short host pause.Trigger the rebase with a margin below
TIMEOUT_MS, and add a boundary regression test for this interval.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 4ef10e9a-134d-489e-8999-23aa449653bc
📒 Files selected for processing (4)
src/relay/dispatcher-client-lifecycle.tssrc/relay/dispatcher-contract.tssrc/relay/dispatcher-frame-codec.tssrc/relay/dispatcher-silent-client-reaper.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review.
There was a problem hiding this comment.
ℹ️ No new behavioral issues in these three follow-up commits — they correctly close the CLI-client and slow-handshake false-reap gaps, and fix the Windows repair-path probe. Two test-hygiene items below.
Reviewed changes
- Reaper skips clients that have never spoken —
lastReceivedAtstartsnulland silence only counts after the first inbound frame, so a relay launched before its client finishes handshaking isn't killed mid-connect. - Reaper skips clients that don't speak keepalives —
keepaliveObservedis set only on inbound keepalive frames, so the one-shotorcaCLI (which waits minutes onorca.cli) is never judged by 20s of silence. - Windows deps probe exits 0 on a real load failure — the repair-path probe gained the
$LASTEXITCODEguard so a non-zeronodeexit printsMISSINGand exits 0, matching the POSIX twin and the sibling install-path probe.
ℹ️ Sleep/wake rebase lost its only test coverage
The "does not reap every client on the first tick after the host slept" test used to exercise the resumedAfterPause rebase, but now that lastReceivedAt is nullable it passes through the lastReceivedAt === null guard instead, because the test client never speaks. The rebase is still load-bearing — a spoken client would be reaped after a >20s host pause without it — yet no test covers a spoken client surviving a pause.
Technical details
# Rebase coverage gap
## Affected sites
- src/relay/dispatcher-silent-client-reaper.test.ts:51 — "does not reap every client on the first tick after the host slept" attaches a client and feeds it nothing, so `lastReceivedAt` stays `null` and the null guard (not the rebase) skips the reap.
- src/relay/dispatcher-client-lifecycle.ts:184 — `if (resumedAfterPause && client.lastReceivedAt !== null)` rebase path is no longer reached by any test.
## Required outcome
- A test where a client that has already sent a keepalive survives a host pause > `TIMEOUT_MS` via the rebase (and is not reaped).
## Suggested approach
- In the sleep test, feed one keepalive frame before `vi.setSystemTime(...)` so `keepaliveObserved` is true and `lastReceivedAt` is non-null, then assert the client is not detached. Optionally add a boundary case around the pause length.ℹ️ Nitpicks
src/relay/dispatcher-silent-client-reaper.test.ts:46— the comment says the unattached primary sink "is expected to be reaped"; withkeepaliveObservedit never speaks and is now skipped, so the comment is stale.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: c60ca9b6-c69e-4748-837b-3bdf4de6e341
📒 Files selected for processing (2)
src/relay/dispatcher-client-lifecycle.tssrc/relay/dispatcher-silent-client-reaper.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review.
There was a problem hiding this comment.
ℹ️ One test-quality item: the new primary-exemption test doesn't actually pin the exemption it names. The dead-band fix itself is correct.
Reviewed changes
- Rebase threshold moved below
TIMEOUT_MS—resumedAfterPausenow arms atTIMEOUT_MS - KEEPALIVE_SEND_MS, so a healthy client whoselastReceivedAtis ~5s stale can never be reaped on a pause, closing the dead band the prior review flagged. - Primary sink exempt from reaping — the reaper skips
primaryClient, whose close would tear down the relay's stdin/stdout with no production revival path. - Tests — a dead-band regression test for the stall scenario (meaningful — it fails at the old
TIMEOUT_MSthreshold), and a primary-exemption test (see inline).
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
ℹ️ The merge reconciliation is clean and adds no new behavioral issues, but the PR is not approvable: the "never reaps the primary client" test still doesn't pin the exemption it names (flagged inline at
dispatcher-silent-client-reaper.test.ts:120). The primary never speaks in that test, solastReceivedAtstaysnulland the reaper already skips it on the null guard — removing theclient === this.primaryClientexemption would not fail the test.
Reviewed changes
The only commit since the last review is a merge origin/main, which reconciles this branch's native-deps probe with the version main already landed in #18000:
- Aligned the probe verdict vocabulary —
probeRequiredNativeDepsnow returnsstatus: 'ok' | 'blocked' | 'unverifiable'(main's naming) instead of the branch'sverdict: 'available' | 'missing' | 'unverifiable'; therepairInstalledNativeDepsgate and re-probe were updated to match. Semantics are preserved: an unanswered probe is stillunverifiable, and only an answeredblockedauthorizes repairingnode_modules. - Adopted main's locked re-probe fallback — a locked re-probe returning
unverifiablenow falls back to the initial probe's answeredmissinglist rather than dropping repair evidence. - Dropped the now-redundant wording — removed the "Native-deps probe did not answer" console warning and replaced the test's warn-text assertion with a behavioral
rm -rf node_modules/node-ptycheck that pins "no answer ⇒ no rewrite".
The merge result is coherent — no stale verdict/available references remain — and the fix's intent (silence is not evidence) survives the reconciliation intact.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
Review finding: the primary-exemption test is vacuous — proven by mutation. Deleting the That includes The exemption is load-bearing in production — a real client answers keepalives, so only the exemption saves it. The code is right; the test cannot detect its removal. Both pullfrog ( Second, unmentioned issue: an untested regression at three call sites. Pre-change, a saturated-writer wedge left the mux alive and requests failed at 30s with
So this deletes the For reference, mosh treats this exact sentence as essential, printing it even as it gives up ( Body accuracy: the "three-state native-deps probe" headline already landed on The core fix is sound and well-supported — removing To unhold: feed the primary a keepalive in that test; preserve or restore the three-call-site wording; correct the body. Note this must land with or immediately before #17928, which fixes a pre-dispatch tombstone bug that this PR widens. |
23d0539 to
c54be7e
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Since the prior review (23d0539), this PR added the following:
- Widened the request-outcome verdict to cover
CONNECTION_LOST— introducedisSshRequestOutcomeUnverifiable(matchingSSH_MUX_REQUEST_TIMEOUT_CODEand theCONNECTION_LOSTdisposition) and switched the three user-facing call sites onto it, so a wedged link'sconnection_lostdispose keeps the "may still be running on the remote host" wording instead of regressing to "could not be reached". - Consumed the typed exec-timeout code —
ssh-remote-platform-detection.tsnow branches onisSshExecTimeoutrather than the/timed out after \d+s$/umessage regex, retiring the previously-unused export and closing the look-alike-message hole. - Bounded the never-spoken client —
reapSilentClientsnow reaps a client that cleared the handshake but never framed anything after six silence windows, rebased across a host suspend, so its socket and client entry can no longer be held for the relay's lifetime. - Fixed the primary-exemption test — the "never reaps the primary" test now feeds the primary a keepalive first, so the exemption (not the null/keepalive guards) is what keeps it alive.
Each of the three verdict sites gained a regression test asserting the unverifiable wording survives CONNECTION_LOST, the predicate itself has a unit test, and the two isSshExecTimeout branches gained look-alike-message coverage.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
c54be7e to
c58e8bb
Compare
…like its POSIX twin
…ng its leases forever
c58e8bb to
0632910
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Since the prior review (c54be7e), this PR landed a single substantive commit on top of two pure rebases onto main:
- Restored the
activityOptionsi18n key —src/renderer/src/i18n/locales/en.jsonregained theactivityOptionsentry (plus the missing trailing comma onshowChildAgents) that a rebase had dropped. The key is consumed byactivity-thread-options-menu.tsx:104, so without it the Activity-options tooltip label would silently fall back to the inline default instead of rendering the locale string.
The restore is correct: the entry nests under auto.components.activity.ActivityPrototypePage as referenced, and its value matches the existing fallback.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Since the prior review (152fc64), this PR landed one commit:
- Unioned
en.jsonwithmain— restored thedashboard.sidebarkeysopenActivity("View activity") andcloseActivity("Turn off activity view") and the trailing comma ondashboardLabel, which the latest rebase had dropped. Both keys are consumed atSidebarHeader.tsx:40-43viatranslate(key, inlineDefault), and those inline defaults already carry the identical strings, so the drop was invisible — but keeping the locale file complete againstmainstops the same keys being dropped again on the next rebase.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…as a verdict (stablyai#17817) * fix(ssh): declare a wedged relay link lost instead of suppressing the dead-link check * fix(ssh): make the Windows deps probe exit 0 on a real load failure, like its POSIX twin * fix(relay): reap a client that has stopped answering instead of holding its leases forever * test(relay): feed the primary before asserting the reaper exemption holds * fix(ssh): keep a lost link's verdict unverifiable instead of reporting absence * refactor(ssh): read the exec timeout from its typed code, not the message text * fix(relay): bound a client that clears the handshake and then never frames anything * fix(i18n): restore the activity-options key the rebase dropped * fix(i18n): union en.json with main so the rebase cannot drop keys

What
Three fixes for one class of bug: treating "no answer" as evidence. Per
docs/reference/ssh-execution-boundary.md, loss of contact is never evidence of process death — and the same mistake was being made in both directions, on both ends of the link.1. A saturated writer suppressed dead-link detection, with no upper bound
SshChannelMultiplexer's health check was gated onwriterSaturated. On a half-open link (sleep/resume, dropped NAT mapping) the transport reports backpressure and never drains, so:ssh-multiplexer-transport-writer.ts:82) silences every keepalive after the first, because that flag only clears on a settlement that never comes;The mux never disposes, so
onRelayLost(ssh-relay-session.ts) never fires and the bounded-backoff reconnect never runs. Every RPC times out at 30s, forever.Saturation no longer suppresses the check. The relay sends its own keepalive every 5s (
src/relay/dispatcher-client-lifecycle.ts), so a slow-but-alive peer still refresheslastReceivedAtand is never falsely killed; only a link delivering nothing inbound for 20s is declared lost, which reconnects.2. The relay had no inbound-liveness signal at all
Symmetric to the above, on the host side.
RelayClienthad nolastReceivedAt; the 5s timer is send-only;frame.ackis never read; there is nosocket.setTimeout; and the writer's drain arm has no timer. So a half-open client parked forever holding its owner lease, with every PTY it held paused, until the OS eventually failed the socket — or never.ssh-owner-recovery-retry.ts:14-17documents the assumption this violated: "the relay frees it when its keepalive notices." It never noticed, which is why the client-side budget for that case is only 1000ms.Clients are now reaped after 20s of silence, with a sleep/wake rebase so a paused host process does not reap everyone on its first tick back. The close cause stays the cautious
'local'default: silence is not evidence the peer died, and the PTYs stay live for the replacement client to reclaim.Three carve-outs, each with its own test: the primary sink (closing it tears down the relay's own stdin/stdout and nothing in production revives it), a client that does not speak the keepalive protocol (the remote
orcaCLI sends oneorca.clirequest and then waits for a result budgeted in minutes), and a client that has not spoken yet (a relay is launched before its client finishes handshaking).That last carve-out was unbounded, which review flagged twice: a client that clears the endpoint handshake and then never frames anything has no
lastReceivedAtto go stale, so its socket, writer and client entry were held for the life of the relay. It now has its own much wider deadline — 6 silence windows, rebased across a host suspend like the other clock — so a real client that is merely slow is never touched and a dead one is still collected.3. Keeping the verdict honest where fix 1 changes it
Fix 1 has a user-visible consequence that has to be paid for here rather than discovered later. Pre-change, a saturated-writer wedge left the mux alive and requests failed at 30s with
SSH_MUX_REQUEST_TIMEOUT. Post-change the mux disposes at 20s anddispose('connection_lost')rejects the pending requests withCONNECTION_LOST.Three sites branched on
isSshMuxRequestTimeoutErrorto choose their wording:source-control-remote-generation.ts:28commit-message-model-discovery.ts:209ai-vault/ssh-session-list.ts:87The timeout branch says "…may still be running on the remote host."; the fallthrough says "could not be reached on the {location}." So fix 1 on its own would have deleted the
unverifiablewording from three user-facing surfaces and replaced it with a claim of absence — exactly the substitution the boundary doc forbids, and the sentence mosh treats as essential (stmclient.cc:229-232: "the mosh-server process may still be running on the server").Both codes mean the same thing — the frame reached the wire and the answer did not come back — so the three sites now branch on
isSshRequestOutcomeUnverifiable, which covers both. Each site has a regression test that fails if the wording is dropped again, plus a unit test on the predicate itself.Also here: two small probe fixes
$LASTEXITCODE, so a real load failure printsMISSINGand exits 0 like its POSIX twin, instead of throwing and being read as "the host never answered".execCommand's timeout error carries a typedSSH_EXEC_TIMEOUT_CODE, andssh-remote-platform-detection.tsnow reads that code instead of matching/timed out after \d+s$/uagainst the message. Previously any error whose message happened to end that way could claim the transport-shaped branch and turn an unsupported-platform answer into a thrown probe failure.Fix evidence
Each fix has a test verified failing before and passing after.
ssh-channel-multiplexer-saturation-wedge.test.tsagainst pre-change code: mux never disposes after 200s, and exactly 1 keepalive is ever written.dispatcher-silent-client-reaper.test.ts: reaps the silent client, keeps the quiet-but-answering one, keeps the primary, keeps a non-keepalive CLI client, does not reap everyone after a simulated host sleep, and still bounds a client that never speaks.CONNECTION_LOSTfromisSshRequestOutcomeUnverifiablefails one test per site plus the predicate's own.ssh-remote-platform-detection.test.ts: restoring the message-text match fails does not read a look-alike timeout message as a timed-out channel.Mutation-checked rather than assumed. Deleting the
client === this.primaryClientguard fromreapSilentClientsused to leave all 7 reaper tests passing — the primary was never fed, so the never-spoken and no-keepalive guards skipped it regardless. The test now feeds it (dispatcher.feed(encodeKeepAliveFrame(1, 0))), which is what a real primary does, and deleting the guard fails it:Relationship to #17748
This supersedes it. #17748's own description names the defect fixed here as a given — "the dead-link check … is deliberately suppressed in exactly that state" — and works around it by extending budgets. With the suppression gone, a wedged writer disposes in ~20s and reconnects, rather than a spawn burning 30s in a queue on a link that is already dead. #17748 would instead raise
SSH_PTY_CONNECT_WORST_CASE_MSto 160s, lengthening the dead-pane window ~6x on exactly the path users complained about. Its orphan-PTY hazard also dissolves here:dispose()clears the writer queue, so a parked frame can never later reach the wire.Worth salvaging from it separately: its two test files, and dequeue-on-timeout in the writer.
Note on scope
An earlier revision of this branch also carried the three-state native-deps probe (
available/missing/unverifiable) for #14830. That landed independently onmainvia #17979 and #18011, so only the Windows$LASTEXITCODEfix and its regression test remain here. #14830 is closed by those PRs, not this one.#17928 is stacked on this branch and must land with it. Fix 1 widens the window in which a
pty.spawnreaches an already-disposed mux, and that path tombstones the operation id for 24 hours even though the request was never framed. Merging this alone makes that bug easier to hit.ELI5
Orca could get stuck talking to a remote machine and never notice. If the network died in a way that leaves the connection technically 'open' (laptop sleep, Wi-Fi change), Orca would wait forever instead of reconnecting. Same bug on the server side: an abandoned Orca window kept holding your terminals hostage. And when Orca gives up on a remote request, it now still tells you the truth — "it may still be running over there" — instead of claiming the machine could not be reached.
User-facing regression risk
'local', so nothing downstream reads it as the peer having died.