Skip to content

fix(desktop): separate LAN and Tailscale pairing endpoints - #9882

Merged
maria-rcks merged 2 commits into
pingdotgg:mainfrom
maria-rcks:fix/triage-lan-endpoint
Sep 5, 2026
Merged

fix(desktop): separate LAN and Tailscale pairing endpoints#9882
maria-rcks merged 2 commits into
pingdotgg:mainfrom
maria-rcks:fix/triage-lan-endpoint

Conversation

@maria-rcks

@maria-rcks maria-rcks commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

When Tailscale is enumerated before Wi-Fi, desktop pairing advertises the tailnet address as both Local network and Tailscale IP. Automatic LAN discovery now skips tailnet addresses while preserving Tailscale-only connectivity and explicit host overrides.

Verified with 14 focused desktop exposure and Tailscale endpoint tests, targeted lint, and desktop typecheck. The updated tests fail against the original source for the two changed behaviors.

lan and tailscale endpoint checks: 14 tests passed

Fixes #7519.

Model: gpt-6-astra via Codex.


Note

Medium Risk
Changes desktop network binding and advertised pairing endpoints; Tailscale-only machines that previously fell back to local-only now remain network-accessible.

Overview
Desktop pairing no longer treats Tailscale IPv4 addresses as the LAN host, so advertised endpoints stay distinct when interface enumeration puts tailnet before Wi‑Fi.

isUsableLanIpv4Address excludes addresses recognized by isTailscaleIpv4Address, and network-accessible mode no longer falls back to local-only when there is no classic LAN host but a non-internal Tailscale IPv4 interface exists (bind stays on 0.0.0.0 with tailnet advertised separately). Bootstrap logging only warns about a local-only fallback when the user requested network access and runtime exposure actually resolved to local-only.

Tests cover Tailscale-before-LAN ordering, Tailscale-only hosts, and explicit T3CODE_DESKTOP_LAN_HOST overrides using tailnet addresses.

Reviewed by Cursor Bugbot for commit 30a4991. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Separate LAN and Tailscale pairing endpoints in DesktopServerExposure

  • isUsableLanIPv4Address now excludes Tailscale IPv4 addresses, so LAN host resolution no longer picks a Tailscale address as the LAN endpoint.
  • resolveRuntimeState keeps network-accessible exposure when a Tailscale non-internal IPv4 address is present, even without a resolved endpoint URL. Previously it fell back to local-only in that case.
  • Desktop startup no longer emits the local-only fallback warning when the server remains network-accessible via Tailscale but has no single endpoint URL.
  • Tests in DesktopServerExposure.test.ts are renamed and expanded to cover Tailscale-only exposure and explicit Tailscale overrides.
  • Behavioral Change: configurations that previously fell back to local-only now stay network-accessible when a qualifying Tailscale address exists; the fallback path is unchanged for configs lacking both an endpoint URL and a Tailscale address.

Macroscope summarized 30a4991.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 5, 2026

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1f69771. Configure here.

Comment thread apps/desktop/src/backend/DesktopServerExposure.ts
@macroscopeapp

macroscopeapp Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 30a4991

Macroscope's review found this PR approvable — This is a contained desktop pairing fix that keeps LAN and Tailscale endpoints distinct and preserves network access for Tailscale-only hosts. The production changes are narrow, directly test-covered, and do not modify defaults, schemas, deployment behavior, or static-analysis configuration.

You can add or adjust custom eligibility rules. Learn more.

@maria-rcks
maria-rcks merged commit 60e1b73 into pingdotgg:main Sep 5, 2026
26 checks passed
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Sep 5, 2026
## What's Changed
* test(web): drop provider banner styling assertions by @juliusmarminge in pingdotgg/t3code#10148
* refactor(client-runtime): remove unused relay token waiter by @juliusmarminge in pingdotgg/t3code#10151
* test(web): drop sidebar artwork styling snapshots by @juliusmarminge in pingdotgg/t3code#10152
* refactor(ssh): keep package internals private by @juliusmarminge in pingdotgg/t3code#10144
* ci: reject unused SSH exports with Knip by @juliusmarminge in pingdotgg/t3code#10145
* refactor(acp): keep protocol implementation exports private by @juliusmarminge in pingdotgg/t3code#10165
* fix(shared): validate cloudflared with the version subcommand by @maria-rcks in pingdotgg/t3code#9880
* fix(desktop): separate LAN and Tailscale pairing endpoints by @maria-rcks in pingdotgg/t3code#9882
* fix(server): install pinned runtime when pnpm node lacks npm by @maria-rcks in pingdotgg/t3code#9923
* fix(web): hide sidebar search shortcut on mobile by @maria-rcks in pingdotgg/t3code#9932


**Full Changelog**: pingdotgg/t3code@v0.0.39-nightly.20260905.1288...v0.0.39-nightly.20260905.1289

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.39-nightly.20260905.1289
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Windows desktop advertises the Tailscale IP for both Local network and Tailscale pairing options

1 participant