Repository navigation
[Bug]: Open in editor dead-ends at "No SSH route" for a same-machine browser reaching the server by LAN IP #23323
mrdowdeswell
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
What happened
I couldn't open VS Code from a worktree — the Open menu said "No SSH route to MBP14". It seemed to happen every time I was in a worktree.
The server and the browser are both on the same Mac. I run
npx t3@nightly serve --host 0.0.0.0(so my iPhone can reach it too), and the browser tab I was using pointed at the machine's LAN address rather than localhost.Diagnosis
Open-in-editor is disabled with a dead-end "No SSH route" state for a browser running on the same machine as the server, purely because the URL host is the machine's own LAN IP instead of a loopback name. Local exec would have worked; there is no fallback to it.
Two conditions combine:
1. A same-machine browser on a LAN-IP URL is classified as remote.
resolveRemoteOpenState(apps/web/src/remoteOpen.ts:64-78) only keepslocal-execfor a primary target when the host is loopback, against a fixed set inapps/web/src/environments/primary/target.ts:76:The server binds
0.0.0.0:3773, and the browser reached it athttp://192.168.0.112:3773— which is this same Mac'sen0address.192.168.0.112is not in that set, so the code decides the viewer is on a different machine and switches to SSH deep-link mode.2. There is no SSH route to fall back on, so it dead-ends.
RemoteOpenTargets.resolveTargets()(apps/server/src/environment/RemoteOpenTargets.ts:37-44) advertises nothing when no sshd is listening:macOS Remote Login is off and Tailscale is not installed, so there is no MagicDNS name and no mDNS candidate either. Empty targets plus remote mode yields
remote-unavailable, which renders the disabled menu item atapps/web/src/components/chat/OpenInPicker.tsx:331and disables the Open button at:297:environmentLabelis the machine's ComputerName, hence "MBP14".The worktree correlation is a red herring.
useRemoteOpenStateis keyed on the environment, not the thread or its cwd, so a worktree thread and a main-branch thread on the same environment resolve identically.projectScriptCwdcorrectly returns the worktree path. The user's worktree threads simply happened to be the recent ones, opened from the LAN-IP tab, while older main-branch threads were used from a loopback tab.Why the URL was the LAN one. Note that the default
servepath is not at fault:startupPresentationdefaults to"browser"(apps/server/src/cli/config.ts:294), andresolveStartupBrowserTarget(apps/server/src/serverRuntimeStartup.ts:257-261) resolves a wildcard host tohttp://localhost:${port}, so the auto-opened tab is already correct. The LAN address is whatresolveHeadlessConnectionString(apps/server/src/startupAccess.ts:45-78) picks for headless output and fort3 pair(apps/server/src/cli/pair.ts:135) — appropriate there, since that URL is meant for a phone. A user who pairs a mobile device and then keeps or bookmarks that URL on the desktop lands in this state permanently.Suggested direction: when the environment is a primary target and the URL host matches one of this machine's own non-internal interface addresses, treat it as
local-execrather than remote. Failing that,remote-unavailableshould fall back to offering local exec instead of disabling the control outright, since the server is by definition reachable and able to spawn an editor.Steps to reproduce
On a machine with no sshd listening on port 22 (macOS with Remote Login off) and Tailscale absent:
npx t3@nightly serve --host 0.0.0.0http://192.168.0.112:3773. (Pairing a phone and reusing the pairing URL on the desktop gets you here naturally; so does bookmarking it.)Expected: VS Code opens the thread's cwd on this machine, as it does when the same server is reached at
http://localhost:3773.Actual: the menu shows a disabled "No SSH route to " item and the Open button is disabled. Opening the identical server at
http://localhost:3773in the same browser makes it work immediately.Not worktree-specific — reproduces on main-branch threads too.
Version
0.0.34-nightly.20260819.1133 (commit 24c4ba6)
Environment
macOS 15 (darwin arm64 24.6.0), Node v24.18.0, Firefox, launched via
npx t3@nightly. No sshd on port 22; Tailscale not installed.Evidence
Related issues
Searched open and closed issues for "SSH route", "remote open", "open in editor", "loopback", "vscode-remote", "worktree" — no match. #4915 (T3 Connect reports "relay offline" when the server binds a non-loopback host) and #4462 (
--tailscale-serveleaves headless backend classified as local-only) are the same family of local-vs-remote misclassification but concern relay and Tailscale classification, not open-in-editor.Fix applied or workaround
Nothing was written to the machine; no database writes and no source patches. The workaround is to open the same server at
http://localhost:3773on the machine itself, which flips the mode tolocal-execand makes Open-in-editor work for worktree and main-branch threads alike.--host 0.0.0.0can stay as-is, since it also serves loopback, so the phone keeps working via the LAN address.Filed by
claude (opus-5) via t3 triage
All reactions