Skip to content

Recommend Tailscale when the remote Orca runtime is unreachable - #6637

Merged
Jinwoo-H merged 3 commits into
stablyai:mainfrom
s546126:s546126/tailscale
Jun 29, 2026
Merged

Jinwoo-H merged 3 commits into
stablyai:mainfrom
s546126:s546126/tailscale

Conversation

@s546126

@s546126 s546126 commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

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 withMacTailscaleDnsHint pattern and reuses Orca's existing Tailscale awareness (orca serve --pairing-address already documents Tailscale addresses; mobile pairing already prefers Tailscale interfaces).

Behavior

  • Endpoint is not Tailscale (LAN / public / NAT):

    …If the server is on another network, connect both devices to Tailscale and pair using its Tailscale address (100.x or a *.ts.net name). See https://tailscale.com/download.

  • Endpoint is Tailscale (*.ts.net or 100.64.0.0/10 CGNAT):

    …The server may be offline on your tailnet, or its Tailscale Funnel reverted to tailnet-only. Confirm it's reachable; re-pair only when adding a new device, since already-paired devices reconnect with their saved token.

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 (not ok:false), so the hint is applied to the thrown error in catch, 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 (RuntimeRpcCallError preserves error.message; extractIpcErrorMessage passes it through). Subscriptions are wired for consistency.

Tests

  • Helper unit tests — both endpoint branches, failure variants, idempotency, CGNAT boundary cases.
  • Integration test driving real socket failures through getRuntimeEnvironmentStatus (returns ok:false), callRuntimeEnvironment (.rejects.toThrow(/connect both devices to Tailscale/)), and subscribeRuntimeEnvironment.
  • 26/26 passing on Node 24; typechecks (node/cli/web) clean.

🤖 Generated with Claude Code

@s546126
s546126 force-pushed the s546126/tailscale branch from 062547c to 82ba4e0 Compare June 28, 2026 19:09
@coderabbitai

coderabbitai Bot commented Jun 28, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

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_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5cccbfc1-958c-48aa-b03f-5057d0291592

📥 Commits

Reviewing files that changed from the base of the PR and between 6d84575 and f24578a.

📒 Files selected for processing (2)
  • src/shared/remote-runtime-tailscale-hint.test.ts
  • src/shared/remote-runtime-tailscale-hint.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/shared/remote-runtime-tailscale-hint.test.ts
  • src/shared/remote-runtime-tailscale-hint.ts

📝 Walkthrough

Walkthrough

A shared helper now exports isTailscaleEndpoint and withRemoteRuntimeTailscaleHint for classifying endpoints and appending Tailscale-specific guidance to remote runtime unreachable errors. That helper is used in main-process IPC routing for runtime status, calls, and subscriptions, and in the web runtime client for WebSocket connection errors and timeouts. New tests cover the shared helper behavior and IPC routing integration.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary and testing, but it omits required template sections like Screenshots, AI Review Report, Security Audit, and Notes. Add the missing template sections, including Screenshots, a fuller Testing checklist, AI Review Report, Security Audit, and Notes.
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding Tailscale guidance for unreachable remote runtime connections.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ts
  • src/main/ipc/runtime-environment-transport-routing.ts
  • src/renderer/src/web/web-runtime-client.ts
  • src/shared/remote-runtime-tailscale-hint.test.ts
  • src/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]>
@s546126
s546126 force-pushed the s546126/tailscale branch from 82ba4e0 to 17e1ff7 Compare June 28, 2026 19:33
…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 Jinwoo-H left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Jinwoo-H
Jinwoo-H merged commit 3f39d75 into stablyai:main Jun 29, 2026
1 check passed
@AmethystLiang AmethystLiang added the orca-remote-server Remote Orca Server / orca serve / paired remote runtime label Jul 22, 2026
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

orca-remote-server Remote Orca Server / orca serve / paired remote runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants