[Bug]: tailscale command can be slow on some machines #16401
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/web
Steps to reproduce#
- Start the app with slow tailscale (ie. on Windows)
- Tailscale option in settings is disabled
Expected behavior#
If Tailscale is available, T3 should expose it.
Actual behavior#
Tailscale is available, but T3 fails to detect it.
Impact#
Major degradation or frequent failure
Version or commit#
main 8f75697b9e022033f2615cb32e3c6ddc61c52353
Environment#
Windows 11
Logs or stack traces#
Tailscale takes about 1.8–2.6s to answer when an app like T3 Code runs it. From a plain terminal it's a bit faster, around 0.9s.
Changing tailscale.ts from
export const TAILSCALE_STATUS_TIMEOUT = Duration.millis(1_500);
to:
export const TAILSCALE_STATUS_TIMEOUT = Duration.seconds(5);
resolves the issue. There could be a config option or override or just larger timeout.
Screenshots, recordings, or supporting files#
No response
Workaround#
Modify tailscale.ts locally and run a dev version or patch asar locally.
michalmocarski(GitHub profile, opens in a new tab) added labelsbug
michalmocarski(GitHub profile, opens in a new tab) added labelsneeds-triage
Note
Grok responding on behalf of Julius.
Triage#
Thanks @michalmocarski for measuring the timings and testing the timeout change, that pinned this down quickly. It still reproduces on current main.
What I found#
readTailscaleStatusstopstailscale status --jsonafter 1500ms (TAILSCALE_STATUS_TIMEOUTinpackages/tailscale/src/tailscale.ts). That's under the 1.8–2.6s you measured when the app spawnstailscale.exe, so the command is treated as failed even though Tailscale is up.- On desktop, that failure is cached as "no MagicDNS name" for 60 seconds, so Connections shows the Tailscale row with no switch and the "Start Tailscale…" text. Tailscale IPs read from the network interfaces are unaffected; only the MagicDNS / Serve control depends on this command. The same 1500ms cap also covers
t3 pairand the server's MagicDNS lookup for open-in-editor targets. - There are budgets around this call:
server.getConfigallows 5 seconds for remote-open target discovery and 5 for direct endpoints, and direct endpoints stop the status-plus-probe work at 3 seconds (TAILSCALE_ENDPOINT_TIMEOUT). A hungtailscale.exeat a 5s timeout would use up the whole discovery budget. Machines without Tailscale aren't affected either way, since a missing binary fails at spawn.
Likely fix area#
- One option is raising
TAILSCALE_STATUS_TIMEOUTto something like 4 seconds, which covers your 2.6s and still fits inside the 5-second discovery cap. The assertion inpackages/tailscale/src/tailscale.test.tscurrently expects 1500ms. DirectEndpointswould still give up at 3 seconds, so a slow status could leave the tailnet HTTPS URL out ofdirectEndpointseven after the settings switch appears. Raising that cap too (keeping status plus the HTTPS probe under 5 seconds) is another piece to consider.- A configurable override is also possible, though it would need to stay within those same outer timeouts.
A maintainer will decide on the fix direction.
juliusmarminge removed labelsneeds-triage
juliusmarminge added labelsvia-triage
juliusmarminge closed this
Sign in to join this conversation.
Happy to raise a trivial PR with timeout bump or get Claude to produce a proper config/override option for this one.