fix(desktop): give the SSH readiness probe room for high-RTT links #7815
ClosedExotic209093(GitHub profile, opens in a new tab)wants to merge 11 commits into
main fromrefs/pull/7815/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
- packages/ssh/src/tunnel.ts line 62OutdatedResolvedby Exotic209093(GitHub profile, opens in a new tab)@@ -52,4 +52,11 @@5252 export const DEFAULT_REMOTE_PORT = 3773;5353 const REMOTE_PORT_SCAN_WINDOW = 200;5454 const SSH_READY_TIMEOUT_MS = 20_000;55-const SSH_READY_PROBE_TIMEOUT_MS = 1_000;55+// Each probe crosses the real SSH link (desktop -> tunnel -> remote), so on a56+// high-RTT connection (satellite/in-flight wifi) a single request can57+// legitimately take longer than a typical LAN round trip. Also feeds the58+// remote-side reuse/launch scripts' own loopback probe (T3_READY_PROBE_TIMEOUT_MS),59+// where the same generous bound is harmless — that probe never crosses the60+// slow link, so it can only make an already-slow remote boot wait a little61+// longer before giving up, never make a healthy one fail faster.62+const SSH_READY_PROBE_TIMEOUT_MS = 8_000;
- packages/ssh/src/tunnel.ts line 62OutdatedResolvedby Exotic209093(GitHub profile, opens in a new tab)@@ -52,4 +52,11 @@5252 export const DEFAULT_REMOTE_PORT = 3773;5353 const REMOTE_PORT_SCAN_WINDOW = 200;5454 const SSH_READY_TIMEOUT_MS = 20_000;55-const SSH_READY_PROBE_TIMEOUT_MS = 1_000;55+// Each probe crosses the real SSH link (desktop -> tunnel -> remote), so on a56+// high-RTT connection (satellite/in-flight wifi) a single request can57+// legitimately take longer than a typical LAN round trip. Also feeds the58+// remote-side reuse/launch scripts' own loopback probe (T3_READY_PROBE_TIMEOUT_MS),59+// where the same generous bound is harmless — that probe never crosses the60+// slow link, so it can only make an already-slow remote boot wait a little61+// longer before giving up, never make a healthy one fail faster.62+const SSH_READY_PROBE_TIMEOUT_MS = 8_000;
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:XS
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
- @@ -4,3 +4,4 @@44 import { HostProcessArchitecture, HostProcessPlatform } from "@t3tools/shared/hostProcess";55 import * as Deferred from "effect/Deferred";66 import * as Duration from "effect/Duration";7+import * as Deferred from "effect/Deferred";
juliusmarminge requested changes
juliusmarminge assignedjuliusmarminge
juliusmarminge added labelspr:needs-julius
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.


Note
Reviews paused#
It 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
reviews.auto_review.auto_pause_after_reviewed_commitssetting.Use the following commands to manage reviews:
@coderabbitai resumeto resume automatic reviews.@coderabbitai reviewto trigger a single review.Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review.
Walkthrough
SSH readiness checks now use an 8-second timeout for tunnel probes. A regression test verifies that a stale tunnel is stopped and recreated after a readiness timeout.
Changes: SSH readiness handling
packages/ssh/src/tunnel.ts,packages/ssh/src/tunnel.test.tsEstimated code review effort: 2 (Simple) | ~15 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers:
gbarros-devPre-merge checks:
4
#7733requires SSH environments to connect when network latency exceeds one second while the tunnel and remote server remain healthy.tunnel.tsuses an 8-second timeout for desktop-side SSH pr…#7733. Timeout separation, bounded stale-tunnel reuse checks, and regression tests directly support reliable SSH connections on high-latency links. No unrelated product…Full details: Linked Issues check
Explanation
Issue
#7733requires SSH environments to connect when network latency exceeds one second while the tunnel and remote server remain healthy.tunnel.tsuses an 8-second timeout for desktop-side SSH probes and keeps the 20-second initial readiness budget. Reused tunnel checks also use the bounded 8-second timeout. Remote loopback probes remain at one second.tunnel.test.tscovers slow responses, repeated connections, tunnel reuse, and stale-tunnel recreation after probe timeout.Full details: Out of Scope Changes check
Explanation
The changes remain within issue
#7733. Timeout separation, bounded stale-tunnel reuse checks, and regression tests directly support reliable SSH connections on high-latency links. No unrelated product behavior is identified.Finishing Touches
🧪 Generate unit tests (beta)
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
f6e3306c-48a3-4c5b-934d-f4d005a4b737📥 Commits
Reviewing files that changed from the base of the PR and between 512908fc8263fdedf928608e20fec7e7f1485cdb and ed43c11282d07841cae5a09f776108cfac7e110e.
📒 Files selected for processing (2)
packages/ssh/src/tunnel.test.tspackages/ssh/src/tunnel.tsIncluded review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.