Repository navigation
fix(remote-terminal): a remote pane comes back on its own once its host answers again - #29444
Merged
Merged
Conversation
…p late resubscribes revivable Rebuilt from #23359 on current main. On OS resume or network return every remote-runtime socket pings once and is replaced if it stays silent for 8 s, the shared-control retry ladder restarts from its short delays, and a resubscribe that fails or opens after the pane's recovery window latched is parked so resume/online can revive it. Co-authored-by: Meapri <104259736+Meapri@users.noreply.github.com>
…ers again A pane whose ~3 min auto-recovery window ran out only came back on an OS online/resume event or a Reconnect click. A Tailscale or VPN route that returns fires neither, so the pane stayed dead over a working link even though the host shell was alive. The environment's shared control socket reaching ready again is now the revive signal: the pane advances its backoff or replays its attach, exactly as Reconnect does. Adds e2e repros for paired runtimes and managed SSH hosts: 30 s silent and reset outages, and a silent outage longer than the recovery window.
… and trim the SSH outage spec
Contributor
|
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 15 seconds. View limit details
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 |
This was referenced Oct 16, 2026
1 of 2 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 the network between Orca and a paired remote Orca computer drops for a few minutes (a Tailscale re-key, a VPN reconnect, a long tunnel) and then comes back, the open terminal used to stay frozen for good, even though the remote shell was still running. You had to click Reconnect or restart Orca. Now the terminal comes back by itself as soon as Orca can talk to the remote computer again.
What Changed
online), the machine waking from sleep, or a Reconnect click. A Tailscale or VPN route that comes back does not change the OS network state, so none of those fire. Orca's control connection to the host reconnected (it retries forever), but the pane never tried again. Reproduced on current main: a paired pane after a 200 s silent outage stays atdisconnectedwith the shell alive and nothing typed reaching it.onSharedControlDiagnosticsbut nobody listened.useRemoteRuntimeRecoveryTriggersnow listens and, on a not-ready to ready transition, callsreviveRemoteRuntimePtyRecoveriesForEnvironment. Each remote pane transport registers a reviver for its environment only while it is recovering or latched (detach and destroy return it to idle, which unregisters it, so a discarded transport is never retained).Why
The control connection answering is positive evidence the host is reachable, which is exactly the moment a pane retry can succeed. Alternatives considered:
online: it never fires for Tailscale/VPN route changes, which is the reported case.No wire change: only client-side reactions to state the client already has. Loss of contact still never marks anything exited; a pane goes from disconnected back to live only by reattaching to the same PTY.
Linked Issue
Fixes #9092
Refs #25783: re-run on the managed-server SSH path at pane level, 30 s silent and reset outages recover on current main without this change (and a 200 s / 300 s silent outage too). The new
ssh-orcad-terminal-network-outage.spec.tskeeps that contract in the managed SSH Docker lane.Visual Proof
N/A: no new UI. The existing reconnect banner now clears on its own once the host is reachable instead of staying until Reconnect.
Testing
tests/e2e/paired-remote-terminal-network-outage.spec.ts(paired runtime through a cuttable TCP proxy): 30 s silent and 30 s reset outages pass on main and with the fix; the 200 s silent outage fails on main (pane staysdisconnected, input never reaches the PTY) and passes with the fix.tests/e2e/ssh-orcad-terminal-network-outage.spec.ts(managed SSH Docker host, profile reached through the same proxy): 30 s silent and reset pass, same shell PID afterwards.Unit:
remote-runtime-pty-transport-stream-reconnect.test.ts(latched pane revived by its environment, not another one; no registration while healthy or after detach),use-remote-runtime-recovery-triggers.test.ts(ready transition revives once per transition). Both new tests fail with the fix reverted. Plus the fix(remote-runtime): recover remote terminals promptly after sleep or network change #23359 tests and a stalled-timer re-probe test.pnpm tc,pnpm run check:code-quality:changedpass. macOS host, Linux Docker SSH host.I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Codex (gpt-6.1-sol, high): (1) the reviver registry retained transports discarded by detach-only cleanup: fixed, it now registers only while recovering. (2) The 8 s wake probe could kill a healthy socket if the process stalled past the deadline: fixed, a late timer re-probes.
Agent skill upstream boundary
Notes
Cross-platform: timers and Electron IPC only. SSH: managed SSH panes use the same transport and control connection, so they get the same revive. Mobile: shared liveness code keeps its unref guard for DOM timer types. Backward compatible with old hosts (WebSocket ping only).
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)