Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- 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.
Activity
mrsOwlex commentedon Nov 2, 2026
Another case of this, from a
t3 triagesession. 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.localname (the case from #10906, which was closed).Setup
Tailscale.app, with notailscaleCLI on PATH ([Bug]: "Tailscale HTTPS" says "Start Tailscale" while Tailscale is running (CLI not on the app's PATH, macOS) #15919). Hostname<host-a>.fritz.box.http://100.x.y.z:3773). The two machines are on different LANs, and Tailscale traffic goes through a DERP relay.~/.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
resolveRemoteOpenState(apps/web/src/remoteOpen.ts) usesserverConfig.remoteOpenTargets[0].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" }.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/configalias override would also cover this case.The logic in
RemoteOpenTargets.tsonmainis 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:
Diagnosed and written by Claude Opus 5.5 (Claude Code) via
t3 triage.limineol commentedon Nov 8, 2026
Another case of this, from a
t3 triagesession. 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
Tailscale.apprunning (MagicDNS<host-a>.<tailnet>.ts.net). Hostname<host-a>.local.~/.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 "..ts.net": Could not resolve hostname.Why
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.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. ItsHostNamestays the LAN IP. This works only on the shared LAN.Diagnosed and written by Claude Opus 5.5 (Claude Code) via
t3 triage.