Repository navigation
fix(remote-terminal): calm, honest reconnect status — one notice per server, cause, delay from measured RTT - #33095
Conversation
Walkthrough
Priority: Merge Risk:
|
7327048 to
037d34a
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

Minor · Do not retry the pane after a failed pairing reconnect. · TerminalPaneRecoveryPortals.tsx:33-41
src/renderer/src/components/terminal-pane/TerminalPaneRecoveryPortals.tsx:33-41
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winDo not retry the pane after a failed pairing reconnect.
runtimeEnvironments.connectcan resolve with{ ok: false, error: { code: 'unauthorized' } }when the pairing refusal remains. The currentfinally(retry)ignores that result and can startretryRecoverywhile the status owner is blocked by the refusal. Retry only after success or a transientruntime_unavailableresult.Suggested fix
.connect({ selector: pairingRefusedEnvironmentId }) + .then((response) => { + if (response.ok || response.error.code === 'runtime_unavailable') { + retry() + } + }) .catch(() => undefined) - .finally(retry)

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
46cb19c6-f05b-4997-9f2f-8f3e62006a8c
Files selected for processing: 4-
src/renderer/src/components/terminal-pane/TerminalPaneRecoveryPortals.test.tsxsrc/renderer/src/components/terminal-pane/TerminalPaneRecoveryPortals.tsxsrc/renderer/src/components/terminal-pane/TerminalRemoteRuntimeReconnectBanner.test.tsxsrc/renderer/src/components/terminal-pane/TerminalRemoteRuntimeReconnectBanner.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
-
ELI5
When the link to a remote Orca server hiccups, every terminal used to flash "Reconnecting to remote runtime" after one second, all at once, and it always said "retrying automatically", even when nothing was retrying. Now Orca waits until a reconnect is clearly taking longer than a normal one. It then shows one calm notice for the server instead of one in every pane, says why and for how long, and only claims it is retrying when it is.
What Changed
Before, for the user:
After, for the user:
*.ts.net, or fd7a:115c:a1e0::/48), the notice showstailscale ping <host>. This reusesremote-runtime-tailscale-hint.ts. Only plain DNS or IP hosts reach the command, so a crafted endpoint can't inject shell syntax.translate()in all 7 locales. The zh strings were written natively (for example "正在重新连接 Studio Mac", "已断开 22秒", "检查 Tailscale 链路:").Mechanism:
src/shared/calm-status-reveal.ts: a pure reveal schedule driven by the clock, shared by desktop and mobile.PtyTransportRecoveryStategains optionalcauseandwaitingfields. These are renderer-local and never sent over the wire. The snapshot controller marks stall-driven closes withstalled: true.parkRetryForExternalTriggernow notifies, so the pane can say it is waiting.remote-server-notice-claims.tskeeps one record per server. It tracks which mounted surfaces observe the outage, so its start time survives a tab switch. It tracks which visible surfaces can speak, and the first one shows the notice. It also tracks which surfaces have the notice on screen, including its hold, so panes on every surface wait it out.TerminalPaneRecoveryPortals.tsx, and the presentation was factored intoRemoteRuntimeRecoveryCard.Why
Measured delay. I drove the real shared-control client against the shared-control test server (real E2EE handshake and auth) through a TCP proxy that adds round-trip latency, then timed a server-side close until the subscription was replayed. Five runs per RTT:
That works out to about 0.3 s + 5.5 RTT. A pane's own resubscribe and snapshot add about 2 RTT, and TLS to a relay adds about 2 more, so one clean reconnect at 400 ms RTT takes about 4.1 s. The old 1 s delay was always crossed at 150 ms RTT or more. A 5 s delay hides one clean reconnect on a relay-like link, while anything longer means an attempt actually failed.
Alternatives considered:
The per-surface claim keeps exactly one notice per server on screen without a new store slice.
ref-oss check: I compared this with how established remote-development clients present reconnects. They show a single connection-level notice rather than one per editor or terminal, reveal it only after a quiet period, and offer an explicit "reconnect now". This design matches that approach, so it did not change.
Linked Issue
No issue. This was reported directly by a user on a desktop paired over Tailscale, likely through a relay with 200–400 ms RTT. Thanks to that reporter.
Visual Proof
CDP screenshots of each state, light and dark, in en and zh. I rendered the real components inside a background-launched dev app (
ORCA_BACKGROUND_LAUNCH=1, isolated profile) so the real theme tokens apply. These are component renders inside the live app, not a captured live outage. The 32 PNGs are available from the author, and attachment upload was unavailable from the agent environment.Testing
calm-status-reveal.test.tscovers the delay, the minimum visible time, the hold, flapping, immediate states, and a carried-over start time.TerminalPaneRecoveryPortals.test.tsxchecks that two split panes produce one notice and no pane banners, and that panes stay quiet during the notice's hold.cause: 'connection'and clears it when healthy.waiting.src/renderer/src/components/terminal-pane,src/renderer/src/runtime,src/renderer/src/components/native-chat,src/shared/remote-runtime, andsrc/renderer/src/hooks. All passed. The mobilesrc/transport,src/session, andsrc/host-screentests also passed.pnpm lint(all ratchets, localization catalogs, extraction and coverage), oxfmt check, run-ratchets, changed-code quality, React Doctor changed lines, Zustand fan-out,pnpm tc, and mobiletsc.Review
Codex review is clean on the final head. The independent review found no P0, P1 or P2 issues. Addressed along the way: probe failures being announced as drops, holds unmounting, the start time across tabs, overlap during the hold on every surface, the timer inside the live region, capacity refusals, the mobile minimum visible time, and validating the host in the pasteable command.
Agent skill upstream boundary
Notes
workspaceOwnerHostId, which covers folder workspaces.selectRemoteServerOutageCausecan map keepalive and wake-probe timeouts to a "stopped responding" variant.