Repository navigation
Conversation
…ng the old session The supervisor ended a session before it started the next one, on resume, on network changes and on route upgrades. On a remote route a resume waited out the 2.5 s silence window before any new connection began, and every switch showed "Syncing threads…" even when the host was reachable. Fixes pingdotgg#30833.
# Conflicts: # packages/client-runtime/src/connection/supervisor.test.ts # packages/client-runtime/src/connection/supervisor.ts
Sticky routes, hedged connects, quieter status, LAN skip, stale deferral, DPoP prefetch, early ticket, ready-on-WS-open, wake renew, and relay endpoint reuse — stacked on seamless resume from pingdotgg#30835. Co-authored-by: Cursor <cursoragent@cursor.com>
Empty states were treating sibling sync errors as hard failures and flashing the disconnected UI while another environment was still connecting. Co-authored-by: Cursor <cursoragent@cursor.com>
Gate prefer-route persistence on a successful initialConfig so a socket that opens to the wrong environment cannot stick for the next cold start. Treat VPN/OTHER like UNKNOWN on mobile so Tailscale-on-Wi-Fi still keeps LAN routes. Co-authored-by: Cursor <cursoragent@cursor.com>
|
This PR changes the test suite by +32 test cases (browser 0, unit +32, server 0). Keep tests that would fail for a real reason, and test logic below the UI where it can be. See Testing. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Depends on / stacked on pingdotgg/t3code#30835 (seamless resume: open the replacement before closing the old session). Merge that first; this layer sits on top.
Mobile sat on “Connecting to MacBook…” for a long time on launch and on resume, even when cached threads were already usable. Reconnect also retried dead paths, raced every saved machine at once, and waited for the full server-config snapshot before feeling connected.
This PR makes cold start and reconnect feel fast: quieter UI, less wasted work on the wire, and earlier transport readiness — without redoing pingdotgg#30835’s side-by-side replace.
What changed (this layer)
1. Remember the route that worked last
Successful connects move that route to the front for next time.
2. Hedge hanging routes
After ~250ms, open a backup in parallel. First ready wins; the loser closes. (Better-route upgrades stay serial so a backup cannot steal the preferred path.)
3. Quieter status over cached data
Cached threads keep a quiet “Updating…” header instead of a loud reconnect banner.
4. Skip LAN when you’re not on a private network
On mobile cellular, drop LAN unless it’s the only saved route.
5. Defer stale environments on cold start
Environments last reached ≥6 hours ago wait 2s so the recent machine gets the first sockets.
6. Warm T3 Connect credentials earlier
Prefetch DPoP tokens on cold start and on app wake / network change for recent T3 Connect environments.
7. Overlap the preferred relay ticket with route checks
Mint the preferred DPoP WebSocket ticket while LAN classification runs.
8. Skip the LAN head-start when no LAN remains
No ~500ms reachability window when the candidate list is remote-only.
9. Ready when the socket opens
session.readyno longer waits for the full server-config snapshot. The UI can leave “Connecting…” as soon as the WebSocket is up; config still arrives oninitialConfig/ subscriptions.10. Empty-state loading while a sibling syncs
Home / new-task empty states keep loading when one environment is connected and another is still syncing, instead of flashing a hard failure.
From pingdotgg#30835 (do not re-review here)
Side-by-side session replace on resume and better-route upgrades — lands with that PR.
Tradeoffs (short)
192.168.x.xserverConfigLeft alone on purpose
Stack note
GitHub base stays
mainuntilfix/mobile-resume-raceexists onpingdotgg/t3code(contributor branch is fork-only). History is based on pingdotgg#30835’s tip merged onto currentmain; the diff will shrink when pingdotgg#30835 merges. Maintainers can retarget--base fix/mobile-resume-raceonce that branch is on origin.Test plan
vp run check:changedCreated with Composer in Cursor (T3 Code).
🤖 Generated with Claude Code