[Bug]: "Open in" editor links ignore the route in use and always target the Tailscale name
Before submitting
- [x] I searched existing issues and did not find a duplicate.
- [x] I included enough detail to reproduce or investigate the problem.
Related, but not the same: #27203 covers a saved SSH route being ignored. #10906 (closed as not planned) covers .local links that do not resolve. This report has no saved SSH route. The environment is connected over a LAN route.
Area
Desktop app, remote environments, "Open in" editor links.
Steps to reproduce
- Run T3 Code on machine A with Tailscale and on the same LAN as machine B.
- On machine B, add machine A as an environment with several routes: LAN, Tailscale, and a public or relay URL.
- Leave the LAN route in use. The Connections screen shows it as "In use".
- Open a project on that environment and choose "Open in VS Code".
Expected behavior
The editor link follows the route the app is using, when that route's host can accept SSH. With a LAN route in use, it should target that LAN host.
Where the active route can't carry SSH, such as a relay or a reverse-proxied URL, the app should fall back to a known target and make clear which host it will use. A per-environment setting for the SSH host or ~/.ssh/config alias would also solve this.
Actual behavior
The link always uses the server-advertised remoteOpenTargets entry, which is the Tailscale MagicDNS name:
vscode://vscode-remote/ssh-remote+<user>@<machine>.<tailnet>.ts.net/...
RemoteOpenTarget.kind only allows tailscale or mdns, so no other host can be chosen, and the route marked "In use" has no effect on the link.
Impact
"Open in VS Code" can use a different network path, and different SSH settings, from the connection that is working in the app.
- If
~/.ssh/confighas a host alias, it is skipped, because the link dials the raw MagicDNS name.IdentityFile,IdentitiesOnly,UserandProxyJumpfrom that block do not apply. - On a machine with key-only SSH, the link failed with
Permission denied (publickey)until the MagicDNS name was added to~/.ssh/configby hand. - If Tailscale is not usable from the client, the link fails even though the app is connected over another route.
Version or commit
0.1.6-nightly.20261031.3978
Environment
Client: Windows 11 on arm64, VS Code 1.144.0, Remote-SSH 0.128.0. Server: Windows 11 on x64.
Logs or stack traces
SSH Resolver called for "ssh-remote+<user>@<machine>.<tailnet>.ts.net", attempt 1
[PermissionDenied]: Error: PermissionDenied (Permission denied (publickey).)
Workaround
Add the MagicDNS name to a Host block in ~/.ssh/config on the client, with the right User, IdentityFile and IdentitiesOnly.
Another case of this, from a t3 triage session. Here the advertised target isn't even the Tailscale name, because the server can't find the Tailscale CLI, so the link falls back to an unresolvable .local name (the case from #10906, which was closed).
Setup
- Machine A (server): macOS arm64, T3 Code desktop 0.1.6 (Beta), sshd listening. Tailscale is installed only as
Tailscale.app, with notailscaleCLI on PATH (#15919). Hostname<host-a>.fritz.box. - Machine B (client): macOS arm64, T3 Code desktop 0.1.6 (Beta). B is connected to A's environment over A's Tailscale IP (
http://100.x.y.z:3773). The two machines are on different LANs, and Tailscale traffic goes through a DERP relay. - B's
~/.ssh/confighas a workingHost 100.x.y.z <alias>block withUser <user-a>.ssh <alias>works.
What happens
"Open in VS Code" on B opens VS Code with ssh-remote+<user-a>@<host-a>.local, and Remote-SSH can't resolve the host.
Why
- No SSH route is saved for the environment, so
resolveRemoteOpenState(apps/web/src/remoteOpen.ts) usesserverConfig.remoteOpenTargets[0]. - On A,
RemoteOpenTargets.tsgets no MagicDNS name, becausereadTailscaleStatusrunstailscale, which isn't on PATH when only the macOS app is installed. It therefore advertises only{ kind: "mdns", host: "<host-a>.local" }. - That name only resolves on A's own LAN.
- The route B is actually using, the Tailscale IP, would have worked for SSH, but it is never considered.
So this issue and #15919 together turn a Tailscale setup that works into one where "Open in" never works across networks. Your suggestion of a per-environment SSH host or ~/.ssh/config alias override would also cover this case.
The logic in RemoteOpenTargets.ts on main is unchanged apart from the new stale-while-revalidate cache.
Workaround
On the client, add the advertised name as an alias to the existing SSH block:
Host 100.x.y.z <alias> <host-a>.local
HostName 100.x.y.z
User <user-a>
Diagnosed and written by Claude Opus 5.5 (Claude Code) via t3 triage.
Another case of this, from a t3 triage session. Here the route in use is T3 Connect, and the client isn't on the server's tailnet, so the advertised MagicDNS name doesn't resolve at all.
Setup
- Server (machine A): macOS arm64, T3 Code 0.1.8-nightly.20261108.4367, sshd listening,
Tailscale.apprunning (MagicDNS<host-a>.<tailnet>.ts.net). Hostname<host-a>.local. - Client (machine B): Linux x64, T3 Code desktop nightly 0.1.8-nightly.20261108.4367, not on A's tailnet and without Tailscale. B reaches A's environment over T3 Connect. The machines share a LAN.
- B's
~/.ssh/confighas a workingHost <alias>block (LAN IP,IdentityFile,IdentitiesOnly,HostKeyAlias).ssh <alias>works.
What happens
"Open in VS Code" opens vscode://vscode-remote/ssh-remote+<user>@<host-a>.<tailnet>.ts.net/..., and Remote-SSH fails with Could not establish connection to "
Why
- A's
RemoteOpenTargets.tsputs the Tailscale target first, ahead ofmdns. It does this whenever MagicDNS is available on the server, whether or not the client can reach the tailnet. resolveRemoteOpenStatetakesremoteOpenTargets[0], because the route in use is the T3 Connect relay, not an SSH profile.- The
mdnstarget (<host-a>.local) is advertised but never tried, and the client's SSH alias is ignored.
Advertising the Tailscale name only to clients that are themselves on a tailnet, or letting the user pick or override the SSH host per environment (as suggested above, and in #27236 for saved SSH routes), would fix this.
Workaround
On the client, add the MagicDNS name to the existing SSH block: Host <alias> <host-a>.<tailnet>.ts.net. Its HostName stays the LAN IP. This works only on the shared LAN.
Diagnosed and written by Claude Opus 5.5 (Claude Code) via t3 triage.