fix(remote): harden runtime liveness and shared-control recovery - #8253
fix(remote): harden runtime liveness and shared-control recovery#8253bbingz wants to merge 6 commits into
Conversation
|
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: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds pause-aware client and server WebSocket liveness with delayed-tick re-baselining and probe-based termination. Refactors shared-control reconnect handling with error classification, jittered backoff, subscription cleanup, stale-timer fencing, fatal-error finalization, and inbound activity tracking. Expands tests for liveness, reconnect behavior, timeout handling, callback isolation, and abnormal socket closure. Adds a design document describing the planned remote terminal recovery architecture, verification procedure, and rollout strategy. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
2d7080a to
5425aab
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: c39a5242-56ea-43bb-93c5-231ea8f5e831
📒 Files selected for processing (18)
docs/reference/2026-07-11-remote-runtime-terminal-recovery-design.mdsrc/main/runtime/rpc/ws-transport.test.tssrc/main/runtime/rpc/ws-transport.tssrc/shared/remote-runtime-client-error-classification.test.tssrc/shared/remote-runtime-client-error-classification.tssrc/shared/remote-runtime-shared-control-connection.test.tssrc/shared/remote-runtime-shared-control-connection.tssrc/shared/remote-runtime-shared-control-frame-handler.tssrc/shared/remote-runtime-shared-control-keepalive-refresh.test.tssrc/shared/remote-runtime-shared-control-open.tssrc/shared/remote-runtime-shared-control-reconnect-delay.test.tssrc/shared/remote-runtime-shared-control-reconnect.tssrc/shared/remote-runtime-shared-control-requests.tssrc/shared/remote-runtime-shared-control-state.tssrc/shared/remote-runtime-shared-control-subscription-start.tssrc/shared/remote-runtime-shared-control-types.tssrc/shared/remote-runtime-socket-liveness.test.tssrc/shared/remote-runtime-socket-liveness.ts
✅ Files skipped from review due to trivial changes (1)
- src/shared/remote-runtime-client-error-classification.ts
🚧 Files skipped from review as they are similar to previous changes (15)
- src/shared/remote-runtime-shared-control-frame-handler.ts
- src/shared/remote-runtime-client-error-classification.test.ts
- src/shared/remote-runtime-shared-control-types.ts
- src/shared/remote-runtime-shared-control-reconnect-delay.test.ts
- src/shared/remote-runtime-socket-liveness.test.ts
- src/main/runtime/rpc/ws-transport.test.ts
- src/shared/remote-runtime-shared-control-open.ts
- src/shared/remote-runtime-shared-control-state.ts
- src/main/runtime/rpc/ws-transport.ts
- src/shared/remote-runtime-socket-liveness.ts
- src/shared/remote-runtime-shared-control-keepalive-refresh.test.ts
- src/shared/remote-runtime-shared-control-subscription-start.ts
- src/shared/remote-runtime-shared-control-connection.ts
- src/shared/remote-runtime-shared-control-reconnect.ts
- src/shared/remote-runtime-shared-control-connection.test.ts
5425aab to
1efbdef
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
fcdff5f to
6b94822
Compare
|
Rebased onto latest Note: skipped |
6b94822 to
eb6c9c3
Compare
Stack status vs merged #9774Audited this foundations PR against current Finding: pause-aware liveness, server heartbeat, shared-control reconnect durability, socket-generation fencing, and “RPC timeout does not thrash the control socket” are already on Remaining deltas look like polish only (fatal-auth stop-retry, hard-cap jitter under 30s). We are routing a close-as-superseded decision through independent review; will close or open micro follow-ups after that confirms. Full audit notes: internal |
|
Closing as superseded by merged #9774 ( Independent review (high confidence) confirmed on current
Residual polish (fatal-auth stop-retry, jitter hard-cap ≤30s) can be tiny follow-ups if still desired — not this stack. #8254 / #8255 stay open for narrowed complementary gaps only. |
Summary
This is PR 1 of a three-PR stack for #8180. It establishes transport recovery foundations without changing terminal stream framing.
Refs #8180
Screenshots
No visual change.
Testing
pnpm lintpnpm typecheckpnpm check:max-lines-ratchetpnpm build:desktopgit diff --check origin/main...HEADThe commands above are a historical validation record from the
origin/main@ff8192a331rebase; the branch has since been rebased again. The verification host used Node 26.5.0 while the repository declares Node 24; pnpm emitted the engine warning, and all commands above still passed.AI Review Report
Independent reviews checked the approved #8180 design, retry/cancellation races, callback reentrancy, mixed-version behavior, and compatibility with the renderer/terminal changes in v1.4.136-rc.0. Findings led to fixes for orphan reconnect timers, jitter exceeding the 30-second cap, close-only authentication failures, and throwing/reentrant fatal callbacks. Final verdict: spec PASS and code APPROVED.
Cross-platform review covered macOS sleep/resume, Linux and Windows timer/network behavior, SSH remote runtimes, and Electron boundaries. This layer adds no shortcuts, filesystem assumptions, dependencies, or wire fields.
Security Audit
Reviewed authentication close handling, E2EE close-code normalization, subscription cleanup, request-timeout behavior, callback isolation, and logging. Fatal authentication/protocol errors stop retrying; recoverable network errors do not expose pairing data or credentials.
Notes
Stack order:
Merge in this order and roll back in reverse order.