Repository navigation
Conversation
…ter the deadline (stablyai#9092) A resubscribe attempt still in flight when the auto-recovery deadline latched (the last attempt's 15 s RPC budget ends at the deadline by design) rejected into a catch that only acted on a live epoch, so the recoverable failure was dropped and nothing was parked. recoverAfter- SubscribeFailure returned early the same way. System resume and network online then had nothing to fire, and the pane stayed disconnected until the user clicked Reconnect, e.g. after a laptop slept through a Tailscale outage. Both paths now park the resubscribe with parkRetryAfterDeadline, the same mechanism the connect path already uses, so retryAllRemoteRuntimePtyRecoveriesNow() opens a fresh recovery window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tablyai#9092) On wake, sockets usually still read OPEN, so the resume/online trigger found no reconnect timer to advance and did nothing. The dead path was only noticed by the regular liveness cadence ~30-40 s later, by which point the one-shot resume signal was spent and shared-control backoff could sit at the 5-minute idle cap earned during the outage. - Liveness monitors register in a process-wide set; a resume probe pings each socket (shared control and per-stream terminal/browser sockets) and declares it dead unless anything arrives within 8 s, which hands it to the existing close/reconnect path. Repeated triggers coalesce. - runtimeEnvironments:retryConnectionsNow now also runs that probe. - SharedControlReconnectScheduler.retryNow resets the attempt count, so a failure right after wake retries from 250 ms. Loss of contact still only resets the connection; nothing here reports remote work as exited. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… IPC probe (stablyai#9092) Two paths from the fix had no failing test without it: a rebound subscribe whose stream open is still pending when a second recovery deadline latches (recoverAfterSubscribeFailure), and runtimeEnvironments:retryConnectionsNow reaching the socket probe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… assertion Uses the checked `'unref' in timer` narrowing already used elsewhere, so the changed-code casting gate stays clean. Behaviour is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe change adds immediate probes for active remote runtime sockets and invokes them after shared-control retries. It resets the reconnect attempt counter when advancing a scheduled retry. It also parks PTY resubscription retries for recoverable failures that occur after recovery enters the disconnected phase. New regression tests cover socket probes, reconnect counters, and PTY retries after recovery deadlines. Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The recovery changes are ready to merge after normal checks; no outstanding failure was established. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The recovery changes act on existing remote connections and terminal attachments rather than adding a new remote command or connection-selection route. No material security regression was established, but broader security coverage remains incomplete. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation Issue [
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: Advanced
Run ID: d59f3757-25d2-4c1c-915b-9b7ace491c2f
📒 Files selected for processing (8)
src/main/ipc/runtime-environment-request-connections.tssrc/main/ipc/runtime-environment-retry-connections-probe.test.tssrc/renderer/src/components/terminal-pane/remote-runtime-pty-deadline-reattach.test.tssrc/renderer/src/components/terminal-pane/remote-runtime-pty-transport.tssrc/renderer/src/components/terminal-pane/remote-runtime-resubscribe-after-deadline.test.tssrc/shared/remote-runtime-shared-control-reconnect.tssrc/shared/remote-runtime-socket-liveness.tssrc/shared/remote-runtime-socket-resume-probe.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
There was a problem hiding this comment.
ℹ️ No critical issues — two follow-ups on the recovery paths, both inline.
Reviewed changes
- Resume probe on wake / network-back —
startRemoteRuntimeSocketLivenessnow exposesprobeNowand registers each monitor in a process-wideactiveMonitorsset;probeAllRemoteRuntimeSocketsNow()pings every live remote-runtime socket with an 8 s deadline, andretryRemoteRuntimeSharedControlConnectionsNow()invokes it alongside the existingretryNow()fan-out. - Backoff reset on resume —
SharedControlReconnectScheduler.retryNow()zeroesattemptbefore firing a pending reconnect so the ladder restarts from 250 ms instead of the idle cap. - Park late resubscribe failures — a recoverable resubscribe failure landing after the auto-recovery deadline latched now goes through
recovery.parkRetryAfterDeadline(...)in bothrecoverAfterSubscribeFailureand theresubscribeAfterTransportClose(...).catch, soonline/ system-resume / Reconnect can revive it. - Tests — IPC wiring test for the probe, unit tests for
probeNow/coalescing and the backoff reset, plus two renderer cases covering the parked late failure on the attach and rebound-subscribe paths.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…l connecting A liveness monitor is installed while its socket may still be CONNECTING, where ping() sends nothing. The resume probe still armed its 8 s deadline, so a slow handshake with no inbound frame could be killed mid-connect. ping() now reports whether it sent, and the probe arms only after a send. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…en is in flight retryNow() only reset the attempt count when a reconnect timer was pending. During an in-flight open the timer is already null, so a wake left the pre-wake attempt and the next failure waited at the long cap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ne (stablyai#9092) The deadline latch invalidates the in-flight subscription, so a stream that opened just after it was discarded and returned normally; nothing was parked and resume/online had nothing to revive. Park it the same way as the late-failure path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Parked the late success of an in-flight resubscribe —
subscribeToHandle's stale-subscription discard now callsparkResubscribeAfterDeadlinewhen the handle is unchanged, the phase latcheddisconnected, and the recovery epoch is still owned, so a stream that resolves after the auto-recovery window closed is held for the next resume / online / Reconnect trigger instead of being dropped. This closes the last asymmetry from the prior review. - Restarted the shared-control backoff on wake while an open is in flight —
SharedControlReconnectScheduler.retryNow()now zeroesattemptbefore the pending-timer guard, so a wake that lands mid-handshake still restarts the ladder at 250 ms; it continues to returnfalseand open nothing when no reconnect is pending. - Made the resume probe skip a socket that is still connecting — the liveness
pingcallback now returns a boolean (both the shared-control and subscription closures returnfalsewhen the socket is notOPEN), andprobeNowreturns without arming the 8 s deadline when nothing was sent, so a mid-handshake socket is not killed by a probe that never left. - Tests — a renderer case that holds the rebound stream open across the whole window and asserts it is parked on success, a unit case that a connecting socket arms no deadline while an open one does, and a scheduler case that a wake during an in-flight open still resets the ladder.
Independent checks of the two fixed paths found no duplicate/conflicting recovery or spurious reconnect: parkRetry is single-slot, a successful superseding subscribe clears any parked retry via markHealthy, and the probe's connecting-skip does not strand a dead socket (half-open reads OPEN and is still probed; CONNECTING is bounded by the 12 s handshake timeout and the unchanged 25 s cadence).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Hi @Jinwoo-H, gentle ping on this PR — clean mergeable state with all checks passing. Whenever you have time, could you please take a look? Thank you! |
…st answers again (#29444) * fix(remote-runtime): probe sockets and reset backoff on wake, and keep 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> * fix(remote-terminal): revive a latched remote pane when its host answers 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. * fix(remote-terminal): hold the control-ready reviver only while a pane is recovering * fix(remote-runtime): re-probe a wake check whose deadline fired late, and trim the SSH outage spec --------- Co-authored-by: Meapri <104259736+Meapri@users.noreply.github.com>

ELI5
When your laptop sleeps, the network connections to a remote Orca computer often die without either side noticing. After you wake the laptop, Orca could take a long time to realise, or give up on a terminal for good, so you had to click Reconnect or restart Orca. Now, as soon as the laptop wakes or the network comes back, Orca quickly checks every connection, replaces the dead ones right away, and brings back terminals that had stopped retrying on their own.
What Changed
Why
The wake and network-back signals were already wired up. They just did nothing when the connections still looked open, and nothing when a terminal had already given up. This fix makes those signals effective and keeps everything else as it is. Alternatives considered:
Context: #17822 (merged) fixed the retry schedule and added the "hold the retry after the window ends" mechanism for first connects. This PR is its follow-up for wake detection and for the reconnect paths it did not reach.
Linked Issue
Fixes #9092
Visual Proof
No visual change: this changes when and how Orca reconnects, not anything it draws. The visible difference is how long the existing reconnect banner stays up after wake. Before, it took about 30–40 seconds or needed a manual Reconnect. After, it takes a few seconds once the network is back.
Testing
New
src/shared/remote-runtime-socket-resume-probe.test.ts: a silent connection is declared dead within the wake-check deadline, one that answers is kept, stopped monitors are skipped, repeated wake events merge into one check, and a connection still being set up is not cut off. A wake also restarts the retry delays from the beginning, including when a reconnect is already under way. 6 of its 7 tests fail with the fix reverted. The seventh checks that a wake with no pending reconnect does nothing, which was already true.New
src/renderer/src/components/terminal-pane/remote-runtime-resubscribe-after-deadline.test.ts: a terminal whose reconnect is still in flight when the automatic window ends is revived by the wake trigger, both when that late attempt fails and when it connects. Both fail with the fix reverted (expected +0 to be 1, nothing held for the wake event).New case in
remote-runtime-pty-deadline-reattach.test.ts: the same situation on the path where the host has published a new terminal and its stream is still opening when the window ends. It fails when only that one-line change is reverted, which the test above does not catch.New
src/main/ipc/runtime-environment-retry-connections-probe.test.ts: the existing wake / network-back request from the window now runs the connection check. It fails with the fix reverted.Existing remote-runtime terminal, shared-control, connection-health, runtime-environment and direct-SSH wake tests: 285 files, 2210 tests pass.
pnpm tc,pnpm run check:code-quality:changed upstream/main,pnpm run audit:anti-slop,check:max-lines-ratchet, oxlint and oxfmt on the changed files all pass. Fullpnpm lintandpnpm buildare left to CI.Unit tests were run on macOS only. I did not reproduce a real sleep over Tailscale by hand. The timing in the tests is driven with fake timers.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Claude Opus 5.5 (via Claude Code) wrote the fix and the tests, directed by a human.
Review
AI code review summary:
onlineevent, both of which exist on macOS, Linux and Windows. The new timer uses the same checkedunrefcall as other main-process timers, so it never keeps the app alive on its own. It has no path, shell or shortcut impact.direct-ssh-runtime-wake-isolation.test.tsx). There is no wire change: the check is a standard WebSocket ping that every supported server, old or new, already answers. Losing contact still only resets the connection. Nothing here reports remote work as exited, which is in line withdocs/reference/ssh-execution-boundary.md.runtimeEnvironments:retryConnectionsNowrequest. There is no new input parsing, logging or permission.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
'unref' in timertest (no behaviour change). Three more commits address review findings: the wake check skips connections still being set up, the retry delays reset on wake even while a reconnect is under way, and a reconnect that connects after the window ended is held like one that fails.Author
X: @mea_pri
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)🤖 Generated with Claude Code