Repository navigation
Description
What happened
On the iOS mobile app (2.3.0, build 248) connecting to a Linux host running T3 Code with Tailscale Serve (--lan --tailscale-serve) and T3 Connect disabled, the app failed to connect and looped indefinitely retrying with a misleading network error:
- Headline:
T3 Code connection to <host>: T3 Code on <host> did not answer Cause: network,Route: Direct,Attempts: 5Error: Failed to fetch remote environment endpoint https://<host>.<tailnet>.ts.net/.well-known/t3/environment (HttpClientError: Transport error ...)
Opening https://<host>.<tailnet>.ts.net/.well-known/t3/environment from Safari on the same iPhone succeeded with 200 OK, and the server's trace showed the iOS app itself was reaching the host and getting 401 (SessionTokenRevokedError) on POST /api/auth/websocket-ticket/rpc rather than failing to reach the server.
Diagnosis
Two routes were saved on the iOS app for the host: a direct Tailscale HTTPS route whose older bearer session had been revoked (401 SessionTokenRevokedError -> ConnectionBlockedError), and a T3 Connect / learned LAN route whose relay was disabled on the host (ConnectionBlockedError).
In packages/client-runtime/src/connection/driver.ts (connectOverRoutes, lines 108–157 at commit 620cf4770d99, unchanged on main as of b99dab9495):
- When an answered route fails with
ConnectionBlockedError,blocked ??= result.failureis recorded whiletransientremainsundefined. - In the fallback loop (
for (const { route } of [...answeredLate, ...stillSilent])), the early exit at line 143 only triggers whentransient !== undefined. Becausetransientis stillundefined,connectOverRoutesproceeds to attempt anystillSilentroute (e.g. an unreachable LAN route while off-LAN, or Tailscale HTTPS during a brief VPN hiccup while LAN answered). - Attempting that
stillSilentroute fails with aConnectionTransientError(Transport error/ timeout), settingtransient. - Line 149 returns
transient ?? blocked ?? ..., so thestillSilentroute's transient network error overrides the answered route'sConnectionBlockedError.
Because EnvironmentSupervisor receives a ConnectionTransientError instead of ConnectionBlockedError (packages/client-runtime/src/connection/supervisor.ts, lines 1263–1328), the client never enters phase: "blocked" to tell the user the session was revoked (or T3 Connect is disabled), and instead retries forever on backoff reporting Cause: network / T3 Code on <host> did not answer.
Steps to reproduce
- Connect the iOS app (
2.3.0) to a host via T3 Connect (so it learns the host's LAN route) and via a directly paired Tailscale HTTPS route (https://<host>.<tailnet>.ts.net). - Revoke the direct pairing session on the host and disable T3 Connect on the host.
- Put the iPhone in a state where one saved route answers (returning
401 SessionTokenRevokedErroror T3 Connect disabled ->ConnectionBlockedError) and another saved route is unreachable (stillSilent, e.g. LAN unreachable off-Wi-Fi, or Tailscale briefly down while on LAN). - Open the iOS app and inspect the connection diagnostics.
- Expected: The app reports the
ConnectionBlockedErrorfrom the answered route (e.g., "T3 Code on <host> did not accept this device — Pair it again") instead of retrying indefinitely with a network error. - Actual:
connectOverRoutesstill attempts thestillSilentroute, hits aConnectionTransientError, and returnstransient ?? blocked, hiding the revoked-session / disabled-T3-Connect error behindCause: networkand looping on retry backoff.
Version
iOS app 2.3.0 (build 248); host server 0.1.12-nightly.20261122.5098 (triage CLI version: 0.1.12-nightly.20261122.5098). Verified still present on main (b99dab9495).
Environment
Client: iOS (T3Code/248, app 2.3.0). Host: Linux x64 (kernel 4.4.302+, Synology DSM), Node v26.13.1, Tailscale 1.104.7 (tailscale serve proxying HTTPS 443 to http://127.0.0.1:3773, --lan --tailscale-serve --no-browser).
Evidence
# Client diagnostics copied from iOS app:
T3 Code connection to <host>: T3 Code on <host> did not answer
This device: ok
T3 Code on <host>: FAILED
Cause: network
Attempts: 5
Route: Direct
App version: 2.3.0
Host version: 0.1.12-nightly.20261122.5098
Error: Failed to fetch remote environment endpoint https://<host>.<tailnet>.ts.net/.well-known/t3/environment (HttpClientError: Transport error (GET https://<host>.<tailnet>.ts.net/.well-known/t3/environment)).
# Server trace (server.trace.ndjson) during the same window showing repeated 200 on descriptor +
# 401 SessionTokenRevokedError on websocket-ticket, yet the client kept retrying on backoff:
2026-11-26T17:02:49.322Z GET /.well-known/t3/environment (https://<host>.<tailnet>.ts.net, UA T3Code/248) -> 200
2026-11-26T17:02:50.157Z SessionStore.verify Failure: SessionTokenRevokedError: Session token revoked.
2026-11-26T17:02:50.157Z POST /api/auth/websocket-ticket/rpc -> 401
... (repeated at 17:03:04, 17:03:20, 17:03:38, 17:04:00, 17:07:25, 17:07:39, 17:07:56)
# Brief window where LAN answered 200 twice per attempt (checkRoute + verifyDirectEndpoint) before
# T3 Connect bootstrap failed, while Tailscale was silent -> surfaced Tailscale Transport error:
2026-11-26T17:08:11.621Z-17:08:55.442Z GET http://<lan-ip>:3773/.well-known/t3/environment (UA T3Code/248) -> 200 (18 requests, 2 per attempt)
# Tailscale resumed answering immediately after, continuing to hit 401 SessionTokenRevokedError on retries:
2026-11-26T17:08:56.396Z GET /.well-known/t3/environment -> 200
2026-11-26T17:08:56.422Z POST /api/auth/websocket-ticket/rpc -> 401 (SessionTokenRevokedError)
... (repeated at 17:10:40, 17:10:53, 17:10:57, 17:11:02, 17:11:31)Related issues
- [Bug]: A Tailscale or LAN route learned through T3 Connect cannot connect when the relay is unreachable: its token is minted through the relay #38671 (Tailscale/LAN route learned through T3 Connect mints its token through the relay) is related to why the learned LAN route failed when T3 Connect was disabled, but does not cover connectOverRoutes overwriting an answered route's ConnectionBlockedError with a stillSilent route's ConnectionTransientError.
- fix(client-runtime): show routes whose host refused this device's sign-in #33199 added refusedRouteIds surfacing when another route connects, but when no route connects, transient ?? blocked still hides the refusal.
Fix applied or workaround
Updated host to 0.1.13-nightly.20261125.5258, removed the old environment/routes on iOS, and re-paired both direct routes with t3 pair --tailscale and t3 pair. Both routes connected immediately.
Filed by
Antigravity (Gemini 4 Neon High) via t3 triage
Activity