Repository navigation
Recommend Tailscale when the remote Orca runtime is unreachable - #6637
Conversation
062547c to
82ba4e0
Compare
|
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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughA shared helper now exports 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: fc1f6ef9-6841-4a13-b683-26d07909f04b
📥 Commits
Reviewing files that changed from the base of the PR and between 7019693 and 062547cbade8985dfb4ff54943839d7eb3ac64c4.
📒 Files selected for processing (5)
src/main/ipc/runtime-environment-transport-routing-tailscale-hint.test.tssrc/main/ipc/runtime-environment-transport-routing.tssrc/renderer/src/web/web-runtime-client.tssrc/shared/remote-runtime-tailscale-hint.test.tssrc/shared/remote-runtime-tailscale-hint.ts
When a remote-runtime connection fails (RemoteRuntimeClientError "Could not connect to the remote Orca runtime."), append an actionable Tailscale hint to the user-facing error, branched on whether the endpoint is already on a tailnet: - Non-Tailscale endpoint: recommend connecting both devices over Tailscale and pairing with its Tailscale address, with a download link. - Tailscale endpoint (*.ts.net or 100.64.0.0/10): point at the real causes — server offline on the tailnet, or Funnel reverted to tailnet-only — and note that already-paired devices reconnect without re-pairing. Applied at the desktop transport chokepoint (status probe, in-use calls, and subscriptions — connection failures reject, so the hint is applied to the thrown error, not just ok:false responses) and at the web client's connect/timeout sites. New pure shared helper mirrors withMacTailscaleDnsHint. Co-Authored-By: Claude Opus 4.8 <[email protected]>
82ba4e0 to
17e1ff7
Compare
…dpoint - isTailscaleEndpoint: gate the 100.64.0.0/10 check on a full IPv4 literal so DNS names like 100.64.0.1.example.com no longer get tailnet-specific advice. - callRuntimeEnvironment: capture the endpoint the queued closure actually used, so a re-pair between enqueue and dispatch can't append the wrong hint. Co-Authored-By: Claude Opus 4.8 <[email protected]>
The remote-runtime Tailscale hint classified IPv6 Tailscale nodes (fd7a:115c:a1e0::/48) and trailing-dot FQDNs as non-Tailscale, so a user already reaching their server over Tailscale by IPv6 literal was wrongly told to 'connect both devices to Tailscale'. Pairing endpoints can carry bracketed IPv6 literals (resolvePairingEndpoint), so this is a reachable path. Normalize the extracted host (strip brackets and the trailing FQDN dot) and add an IPv6 ULA-range check. Co-authored-by: Orca <[email protected]>
Jinwoo-H
left a comment
There was a problem hiding this comment.
Thanks for this — the endpoint-aware branching is the right call (not telling a Tailscale-Funnel user to "use Tailscale"), and driving real socket failures through the IPC chokepoint in the integration test is exactly the right level to prove the wiring.
Reviewed end to end and verified locally: 26/26 tests pass, typecheck (node/cli/web) and lint clean, and I confirmed the augmented message propagates verbatim to the renderer (RuntimeRpcCallError → extractIpcErrorMessage).
One hardening commit on top:
- IPv6 + trailing-dot endpoints — Tailscale also assigns each node an IPv6 address (
fd7a:115c:a1e0::/48), and pairing endpoints can carry a bracketed IPv6 literal (resolvePairingEndpoint). The helper classified those as non-Tailscale, so a user already reaching their server over Tailscale by IPv6 would have been wrongly told to "connect both devices to Tailscale." Normalized the extracted host (strip[...]brackets and trailing FQDN dot) and added an IPv6 ULA check, with regression tests that fail on the un-fixed source.
Mobile is intentionally out of scope here — it can't import the src/shared helper (Metro) and surfaces structured connection verdicts rather than raw error strings, so it needs a purpose-built affordance. Filed as #6784.
…lyai#6637) * Recommend Tailscale when the remote Orca runtime is unreachable When a remote-runtime connection fails (RemoteRuntimeClientError "Could not connect to the remote Orca runtime."), append an actionable Tailscale hint to the user-facing error, branched on whether the endpoint is already on a tailnet: - Non-Tailscale endpoint: recommend connecting both devices over Tailscale and pairing with its Tailscale address, with a download link. - Tailscale endpoint (*.ts.net or 100.64.0.0/10): point at the real causes — server offline on the tailnet, or Funnel reverted to tailnet-only — and note that already-paired devices reconnect without re-pairing. Applied at the desktop transport chokepoint (status probe, in-use calls, and subscriptions — connection failures reject, so the hint is applied to the thrown error, not just ok:false responses) and at the web client's connect/timeout sites. New pure shared helper mirrors withMacTailscaleDnsHint. Co-Authored-By: Claude Opus 4.8 <[email protected]> * Address review: scope CGNAT hint to IPv4 literals, track re-paired endpoint - isTailscaleEndpoint: gate the 100.64.0.0/10 check on a full IPv4 literal so DNS names like 100.64.0.1.example.com no longer get tailnet-specific advice. - callRuntimeEnvironment: capture the endpoint the queued closure actually used, so a re-pair between enqueue and dispatch can't append the wrong hint. Co-Authored-By: Claude Opus 4.8 <[email protected]> * Recognize Tailscale IPv6 endpoints and trailing-dot FQDNs in hint The remote-runtime Tailscale hint classified IPv6 Tailscale nodes (fd7a:115c:a1e0::/48) and trailing-dot FQDNs as non-Tailscale, so a user already reaching their server over Tailscale by IPv6 literal was wrongly told to 'connect both devices to Tailscale'. Pairing endpoints can carry bracketed IPv6 literals (resolvePairingEndpoint), so this is a reachable path. Normalize the extracted host (strip brackets and the trailing FQDN dot) and add an IPv6 ULA-range check. Co-authored-by: Orca <[email protected]> --------- Co-authored-by: s546126 <[email protected]> Co-authored-by: Claude Opus 4.8 <[email protected]> Co-authored-by: Jinwoo-H <[email protected]> Co-authored-by: Orca <[email protected]>
Summary
When a remote-runtime connection fails —
RemoteRuntimeClientError: Could not connect to the remote Orca runtime.— the user-facing error now carries an actionable Tailscale recommendation, branched on whether the endpoint is already on a tailnet.This mirrors the existing
withMacTailscaleDnsHintpattern and reuses Orca's existing Tailscale awareness (orca serve --pairing-addressalready documents Tailscale addresses; mobile pairing already prefers Tailscale interfaces).Behavior
*.ts.netor100.64.0.0/10CGNAT):The branch avoids telling a user already reaching their server over Tailscale Funnel to "use Tailscale," and the copy reflects that already-paired devices keep their token across server restarts.
Changes
src/shared/remote-runtime-tailscale-hint.ts(new) — pure, dependency-free helper. Gates on the unreachable-error family, is idempotent, and detects Tailscale endpoints (*.ts.net/100.64.0.0/10).src/main/ipc/runtime-environment-transport-routing.ts— applies the hint at the desktop chokepoint: status probe (settings pane), in-use calls, and subscriptions. Connection failures reject (notok:false), so the hint is applied to the thrown error incatch, not only to error responses.src/renderer/src/web/web-runtime-client.ts— applies the hint at the web client's connect-error and connect-timeout sites.Surfaces covered
Both the settings status probe and in-use toasts render the augmented message verbatim (
RuntimeRpcCallErrorpreserveserror.message;extractIpcErrorMessagepasses it through). Subscriptions are wired for consistency.Tests
getRuntimeEnvironmentStatus(returnsok:false),callRuntimeEnvironment(.rejects.toThrow(/connect both devices to Tailscale/)), andsubscribeRuntimeEnvironment.🤖 Generated with Claude Code