Repository navigation
Conversation
…uggesting Tailscale for LAN addresses Unreachable-runtime errors now append the sanitized endpoint that was dialed, and a private LAN endpoint gets a hint to re-pair with a reachable address instead of "connect both devices to Tailscale". Moves classifyRemotePairingHostname and endpointForDisplay unchanged into remote-pairing-endpoint.ts so the hint module can reuse both without pulling in pairing-code parsing. Refs stablyai#14210
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe change moves hostname classification and endpoint display helpers into Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The change improves remote connection error messages so they name the endpoint that was dialed and give guidance suited to its type. No concrete merge-blocking risk was identified. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The new guidance names the dialed address without showing credentials or link contents, and the reviewed paths do not grant new connection authority. Coverage is incomplete, so this is not a finding of zero risk. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation
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: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 39353237-421f-4d40-9d2b-0d3a563f066f
📒 Files selected for processing (6)
src/shared/remote-pairing-address.tssrc/shared/remote-pairing-endpoint.tssrc/shared/remote-runtime-connect-bound.test.tssrc/shared/remote-runtime-connect-bound.tssrc/shared/remote-runtime-tailscale-hint.test.tssrc/shared/remote-runtime-tailscale-hint.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the complete diff of #22529 (6 files, 1 commit) against main.
- New dependency-free module —
classifyRemotePairingHostname,getEmbeddedIPv4Address, andendpointForDisplaymoved unchanged intosrc/shared/remote-pairing-endpoint.ts;remote-pairing-address.tsre-exports the classifier so its existing callers are untouched. - Dialed endpoint in the message —
withDialedEndpointappends(dialed <scheme>://<host>)through the existingendpointForDisplaysanitizer, skips when the message already names that string, and preserves the trailing period and the recoverableCould not connect to the remote Orca runtimephrase. - Endpoint-kind hint —
hintForEndpointkeeps the tailnet hint for Tailscale addresses and adds aLAN_ENDPOINT_HINTfor private LAN addresses that no longer recommends installing Tailscale; public/loopback/custom keep the existing hint. - Tests — new cases in
remote-runtime-tailscale-hint.test.ts(LAN, tailnet, sanitized/unsafe hosts, idempotence, no-duplicate endpoint, pass-through);remote-runtime-connect-bound.test.tsmoves its gate test off a LAN endpoint so it still asserts the Tailscale remedy.
Verified locally: the 7 touched/related suites (68 tests) plus the renderer outage suite pass, and pnpm tc:node / pnpm tc:web are clean.
ℹ️ Loopback pairing endpoints still recommend Tailscale
A ws://127.0.0.1:…/localhost pairing address can no more be reached from another device than a LAN address, yet it still takes OTHER_NETWORK_HINT ("connect both devices to Tailscale…"). The classifier wired in here already returns loopback, so folding it into the new branch is a one-condition change if you want it covered later. Flagging only — the scoping note in the PR body is clear.
Technical details
# Loopback endpoints take the Tailscale hint
## Affected sites
- src/shared/remote-runtime-tailscale-hint.ts:117 — `classifyRemotePairingHostname(host) === 'lan'` is the only kind routed to `LAN_ENDPOINT_HINT`; `loopback` falls through to `OTHER_NETWORK_HINT`.
## Required outcome
- None required for this PR (explicitly out of scope). If extended: a loopback pairing endpoint should also get the "only works from the server's own network" guidance rather than "install Tailscale".
## Open questions for the human
- Is loopback intentionally deferred, or worth folding into the same branch (the `loopback` kind is already available from the reused classifier)?DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Re-reviewed #22529 at c198f02, covering the one commit pushed since the prior pullfrog review (8fd0f5d).
- IPv4-mapped IPv6 tailnet endpoints —
hintForEndpointnow also consultsclassifyRemotePairingHostnameand routes atailscalekind to the tailnet hint.isTailscaleEndpointalone misses IPv4-mapped literals such asws://[::ffff:100.64.0.5]:6768, because WHATWG URL normalizes the host to::ffff:6440:5— which neitherIPV4_LITERAL_REnorTAILSCALE_IPV6_RErecognizes — whilegetEmbeddedIPv4Addressdecodes it back to100.64.0.5. - Test — a case pinning that endpoint to the tailnet hint and asserting the Tailscale download hint is absent.
I verified the normalization path directly (new URL('ws://[::ffff:100.64.0.5]:6768').hostname === '[::ffff:6440:5]') and that the new case would fail without the classifier branch. The 6 related suites (68 tests) and pnpm tc:node are green.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
The hint fed `extractHost`'s lenient non-URL fallback into `classifyRemotePairingHostname`, which was written for `URL.hostname`. The fallback split a bracketed IPv6 literal on its first colon, so `[fd7a:115c:a1e0::1]:6768` arrived as `fd7a`, and the classifier read any four-hex-character label as a ULA hextet. A plain host (`fdab`) and a bare Tailscale IPv6 endpoint both came out as 'lan'. Keep the bracketed literal whole in the fallback, and require an IPv6 shape before reading a hextet.
…t all Three things the error family got wrong once it started naming the endpoint: - Two renderings of the same fact. The handshake-timeout message already said `at <endpoint>`; the hint appended `(dialed <endpoint>)`. Settle on `at`, and replace the substring dedupe (which would suppress `ws://a.example` inside a message naming `ws://a.example.com`) with a check that the following character cannot extend the host or its port. - A host that fails the display gate produced the zero-information clause "(dialed the paired endpoint)". `displayableEndpoint` now returns null and the clause is dropped; `endpointForDisplay` keeps the noun for the one sentence that needs a subject there. - `ws://[::ffff:100.64.0.5]:6768` displayed as `ws://[::ffff:6440:5]:6768`, because WHATWG URL recompresses the literal. Decode it with the `getEmbeddedIPv4Address` the classifier already uses. Also make the LAN hint honest: it asserted "only works from the server's own network", which is false over a routed VPN, and it dropped the tailscale.com/download pointer a user who is not on a tailnet still needs. It now states the condition, keeps the link, and names the usual same-network cause (host asleep or firewalling the port). Its opening subject is chosen from whether an address was actually printed, so "That" never dangles.
The suite named three environments `lan-host` but seeded every one of them with `ws://127.0.0.1:9`, so the LAN branch was never reached through the actual WebSocket failure path and all four cases still asserted the generic hint. Rename those fixtures to `loopback-host` and add a genuine private address, so a call site that stops passing the endpoint, or a wrapper that re-mangles the message, now fails here.
`remote-pairing-address.ts` and `remote-pairing-endpoint.ts` were near-synonyms with no discoverable boundary. The residue holds only `parseHostAccessLink` and its result types, so call it `remote-pairing-access-link.ts`; the classifier's three importers now take it from `remote-pairing-endpoint` directly, which removes the compat re-export, and the classification cases move to that module's own suite.
|
Heads up @mmarabel — @nwparker has taken this over and pushed four commits on top of yours (no force-push, your commits are untouched). Thanks for the original fix; the shape was right, and the choke point you picked was the correct one. What changed on top:
The PR body is rewritten with before/after screenshots of the real toast, and it now states explicitly that this does not close #14210 (observations 2–4 and the headline handshake defect remain). Fork CI is approved and running. |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 495bd6db-59a6-4b8e-ab83-0ca18bc4b0ee
📒 Files selected for processing (19)
src/main/ipc/local-network-connection-test.tssrc/main/ipc/mobile.tssrc/main/ipc/runtime-environment-pairing-verification.tssrc/main/ipc/runtime-environment-transport-routing-tailscale-hint.test.tssrc/renderer/src/components/settings/RuntimeHostAccessForm.tsxsrc/renderer/src/components/sidebar/AddRemoteHostDialog.tsxsrc/renderer/src/components/sidebar/AddRemoteHostFields.test.tsxsrc/renderer/src/components/sidebar/AddRemoteHostFields.tsxsrc/renderer/src/components/sidebar/AddRemoteHostServerFormPanel.tsxsrc/renderer/src/lib/remote-pairing-copy.tssrc/renderer/src/web/preload-api/web-runtime-environments-api.tssrc/shared/remote-pairing-access-link.test.tssrc/shared/remote-pairing-access-link.tssrc/shared/remote-pairing-endpoint.test.tssrc/shared/remote-pairing-endpoint.tssrc/shared/remote-runtime-connect-bound.test.tssrc/shared/remote-runtime-tailscale-hint.test.tssrc/shared/remote-runtime-tailscale-hint.tssrc/shared/runtime-environment-store.ts
💤 Files with no reviewable changes (1)
- src/shared/remote-pairing-access-link.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Re-reviewed #22529 at 13b567a, covering the four commits pushed since the prior pullfrog review (c198f02).
- Module split —
remote-pairing-address.tsis nowremote-pairing-access-link.ts(access-link parsing and its result types only); the hostname classifier, embedded-IPv4 decoder, and display sanitizer moved into the new dependency-freeremote-pairing-endpoint.ts. - One endpoint phrasing — the hint now appends
at <scheme>://<host>(matching the connect-bound timeout path) instead of(dialed …), andnamesEndpointreplaces the substring dedupe with a token-boundary check so a host that merely prefixes another (ws://a.examplevsws://a.example.com) is no longer swallowed. - Sanitizer returns
null—displayableEndpointomits the address clause entirely when the host is unsafe or unparseable instead of printing a placeholder, and decodes IPv4-mapped IPv6 literals to the dotted quad the user pasted. - Conditional LAN hint — the LAN copy states the condition rather than asserting an unverifiable cause, names its own subject (
The paired address…) when no address is shown, and keeps the Tailscale download link. - IPv6 hardening — bracketed literals stay whole during schemeless host extraction, and the ULA/link-local classifier requires an IPv6 shape so a four-hex hostname like
fdabis no longer reported as local-only. - End-to-end coverage — the transport-routing suite now seeds a real LAN address and asserts the LAN hint through the actual WebSocket failure path; fixtures previously named
lan-hostwhile using loopback are renamedloopback-host.
Verified locally: 9 related suites (77 tests) pass, including the new transport integration case; pnpm tc:node, pnpm tc:web, pnpm tc:cli, and pnpm run check:code-quality:changed are clean.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Re-reviewed #22529 at f6b4b30, covering the one commit pushed since the prior pullfrog review (13b567a).
- Route-aware LAN guidance —
LAN_ENDPOINT_HINT_BODYnow conditions re-pairing on the client having no route to the dialed address (If this device has no route to that address, re-pair … If a route exists, check that the server is awake and not firewalling the port), replacing the earlier "not on the server's network" assertion that a routed VPN makes false. The rationale comment states the routing caveat. - Test coverage — the exact-string LAN case, the conditional-hint case, and the transport-routing integration case all assert the new phrasing and reject the old ("not on the server's network", "cannot reach it"), so a revert of the copy fails.
Verified locally: src/shared/remote-runtime-tailscale-hint.test.ts (22 tests) and src/main/ipc/runtime-environment-transport-routing-tailscale-hint.test.ts (5 tests) pass.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

ELI5
When Orca cannot reach a paired computer, the error message now tells you which address it tried to reach. If that address is a home or office network address (like
192.168.1.20), the message says so and explains that it only works when your device is on that same network. It no longer tells you to install Tailscale when you are already on Tailscale — and when Tailscale genuinely is the fix, it still gives you the download link.What Changed
Before. A pairing link carried a local-network address,
ws://192.168.1.20:6768. A laptop on the same tailnet but not on that LAN could never reach it. Orca's error said:Two things are wrong there. It never says which address failed, so the real cause — an unreachable address baked into the pairing link — is invisible. And it recommends Tailscale to someone whose devices are both already on Tailscale.
After.
The mechanism.
withRemoteRuntimeTailscaleHintinsrc/shared/remote-runtime-tailscale-hint.tsis the one function every one of these errors passes through — the settings status probe, in-use calls, subscriptions, the Tailscale IPC response wrapper, and the browser client's two connection waiters. It used to make a binary choice: tailnet endpoint → tailnet advice, everything else → "connect both devices to Tailscale". It now does three things instead.at <scheme>://<host>before the trailing period, the same phrasingremoteRuntimeConnectFailureMessagealready used on the handshake-timeout path, so the whole error family reads as one message rather than two. It skips the clause when the message already names that address, and the dedupe is a token check, not a substring check, so a message namingws://a.example.comno longer swallows a realws://a.example.classifyRemotePairingHostname. Tailnet keeps the tailnet hint; a private LAN address gets the new LAN hint; everything else keeps today's hint.terminal_gone. That sanitizer now returnsnullinstead of a placeholder, so when there is nothing safe to print the clause is left out entirely rather than degrading to "(dialed the paired endpoint)". It also decodes IPv4-mapped IPv6 literals, sows://[::ffff:100.64.0.5]:6768prints asws://100.64.0.5:6768and not the browser's recompressedws://[::ffff:6440:5]:6768.Supporting moves:
classifyRemotePairingHostnameand the display sanitizer now live insrc/shared/remote-pairing-endpoint.ts, free of pairing-code parsing (zod, Buffer) so the hint module — which mobile and the browser client both import — can reuse them. The residue that only parses access links was renamedremote-pairing-access-link.ts, and its three classifier consumers import from the endpoint module directly, so there is no compatibility re-export left behind.Two defects were found and fixed while taking this over:
hintForEndpointfed the output of a lenient regex host extractor into a classifier written forURL.hostname. The extractor split a bracketed IPv6 literal on its first colon ([fd7a:115c:a1e0::1]:6768→fd7a), and the classifier read any four-hex-character label as a ULA hextet. The result: a plain hostname likefdab, and a schemeless Tailscale IPv6 endpoint, were both told "that is a local-network address" — the exact misdirection this PR exists to remove. Fixed at both ends: the fallback keeps a bracketed literal whole, and the classifier requires an IPv6 shape before reading a hextet.192.168.x.xover a routed VPN, and it dropped the tailscale.com/download link that a user who is not on a tailnet still needs. The claim is now conditional, the link is back, and the most common same-network failure (host asleep or firewalling the port) is named.Why
The helper is the only choke point that reaches all six call sites with one edit. Pushing the endpoint into the message constructors instead would have missed
src/renderer/src/web/web-runtime-connection-waiters.ts, which builds its two strings as inline literals rather than going throughremoteRuntimeConnectFailureMessage, and it would have put presentation copy into wire-adjacent producers the CLI and mobile also consume.For the classifier bug, the alternative was to merge
isTailscaleEndpointandclassifyRemotePairingHostnameinto one function. That is the wrong cut:isTailscaleEndpointis the authoritative tailnet test used at five mobile call sites, and running it first is what keeps the classifier'sfd7a/ts.netblind spots from mattering here. The real duplication was two host extractors with different contracts wired into each other, so the fix narrows what reaches the classifier rather than rewriting it.Not in scope, deliberately: loopback endpoints still take the generic hint; the classifier's mislabelling of
fd7a:…and*.ts.netin the Add Remote Host and Settings UI is a separate change that moves an IP-admission gate inlocal-network-connection-test.ts; and makingGenerate Access Linkprefer a reachable address is a different fix in a different file.Linked Issue
Refs #14210 — observation 1 only. This PR does not close #14210 and the issue must stay open. It has four observations, and only the first (the LAN pairing address producing a misleading Tailscale error) is addressed here. Still open after this merges:
orca environment rmcrashes the client.orca environment add --nameUX.Visual Proof
Captured from the real app: a host paired at
ws://192.168.1.20:6768in Settings → Remote Orca Servers, then Connect. The screenshots are the actual error toast, taken over CDP from a background-launched dev build (ORCA_BACKGROUND_LAUNCH=1); the only difference between the two runs issrc/shared/remote-runtime-tailscale-hint.tsatmainvs. at this branch.Before — no address, and Tailscale advice for a LAN address:
After — the address is named, the advice matches the address, and the download link is still there for someone who needs it:
The same string also renders inline on the server row in that pane.
Testing
Reproduce the screenshots above:
ws://192.168.1.20:6768. (The Add Server dialog probes reachability first, so seed it the way the CLI does —addEnvironmentFromPairingCode(userDataPath, { name, pairingCode })— or useorca environment add --pairing-code.)ws://192.168.1.20:6768, call it a local-network address, and not say "connect both devices to Tailscale".Automated, all run locally and green:
src/shared/remote-runtime-tailscale-hint.test.ts— 22 cases, including the LAN exact string, the four-hex hostname (ws://fdab:6768), the bare and bracketed Tailscale IPv6 endpoints, the IPv4-mapped literal's rendered address, the prefix-host dedupe trap, and the unsafe host emitting no address clause.src/shared/remote-pairing-endpoint.test.ts— new; the classification table (with the hostname-that-looks-like-a-ULA rows) and the display sanitizer.src/main/ipc/runtime-environment-transport-routing-tailscale-hint.test.ts— a real LAN endpoint now goes through the actual WebSocket failure path. The suite previously named three fixtureslan-hostwhile seeding all of them with loopback, so the LAN branch had no end-to-end coverage; those fixtures are renamedloopback-host.src/shared/remote-runtime-connect-bound.test.ts— the LAN endpoint that had been retargeted to a public host is back as a sibling assertion on the wrapped path.AddRemoteHostFields.pnpm tc(node, web, cli) andpnpm run check:code-quality:changedpass.Each new assertion was verified to fail with its production change reverted.
Platforms: exercised on macOS (the screenshots above). The change is platform-independent string handling; the author tested the original on Linux. Not exercised on Windows.
AI Disclosure
Original change written with Claude Opus 5.5 in the pi coding agent by the author. Taken over and extended by @nwparker with Claude Opus 5.
Review
…runtime at ws://….). The substrings error classification keys on (could not connect to the remote orca runtime,remote orca runtime closed the connection,timed out …) are untouched, and no production code exact-matches the hinted text. The helper is still idempotent.remote-pairing-address.ts→remote-pairing-access-link.tsis mechanical: it now holds onlyparseHostAccessLinkand its result types. Its test file split accordingly.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
[a-z0-9.-]/ a bracketed IP literal, which is what stops a pasted endpoint from smuggling a token such asterminal_goneinto a message other consumers substring-match.isTailscaleEndpointfrom this module, whose signature and behaviour are unchanged. Its own copy paths (mobile/src/transport/connection-health.ts:108,mobile/src/diagnostics/host-reachability.ts:66) branch onisTailscaleEndpointalone and emit no Tailscale advice for a non-tailnet endpoint, so they never had the defect this PR fixes and were left alone. Mobile pulls in no new dependency: the hint module already imported fromremote-pairing-endpoint, whose only import is the puretailnet-address.ts.new URLparse on an error path.runtime-environment-store.ts,main/ipc/mobile.ts,local-network-connection-test.ts,parseHostAccessLink) all pass a realURL.hostname, andlocal-network-connection-test.tsalready gates onisIP()before using thelanverdict, so none of them change.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)