Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: tailscale command can be slow on some machines #16401

Closedmichalmocarski(GitHub profile, opens in a new tab) opened this issue 2 comments

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

  1. Start the app with slow tailscale (ie. on Windows)
  2. 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.

  1. michalmocarski(GitHub profile, opens in a new tab) added labelsneeds-triage

  2. Happy to raise a trivial PR with timeout bump or get Claude to produce a proper config/override option for this one.

  3. 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

    • readTailscaleStatus stops tailscale status --json after 1500ms (TAILSCALE_STATUS_TIMEOUT in packages/tailscale/src/tailscale.ts). That's under the 1.8–2.6s you measured when the app spawns tailscale.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 pair and the server's MagicDNS lookup for open-in-editor targets.
    • There are budgets around this call: server.getConfig allows 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 hung tailscale.exe at 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_TIMEOUT to something like 4 seconds, which covers your 2.6s and still fits inside the 5-second discovery cap. The assertion in packages/tailscale/src/tailscale.test.ts currently expects 1500ms.
    • DirectEndpoints would still give up at 3 seconds, so a slow status could leave the tailnet HTTPS URL out of directEndpoints even 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.

  4. juliusmarminge removed labelsneeds-triage

  5. juliusmarminge added labelsvia-triage

  6. juliusmarminge closed this

Sign in to join this conversation.