You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Open in editor uses an SSH remote link when the desktop app's saved connection points at a server on the same machine #25781
I'd like to take this. Please assign it to me (@watashiwaaniket). I won't open a PR until it's assigned.
What the code does
Open in Cursor picks a mode in resolveRemoteOpenState (apps/web/src/remoteOpen.ts), then OpenInPicker.tsx either asks the server to launch the editor or opens an SSH URL from buildRemoteOpenUrl (packages/contracts/src/editor.ts).
local-exec is only returned for:
the desktop app's own primary connection, even when that primary is a non-loopback address (the existing test covers this, including when Tailscale hosts are advertised)
a desktop-managed backend whose connection id starts with local:
A saved connection is a bearer target. It is neither of those, and the function never checks whether that server is this computer. If serverConfig.remoteOpenTargets is non-empty, the first host becomes remote-links, and Cursor gets cursor://vscode-remote/ssh-remote+<host>/<path>.
Those targets come from RemoteOpenTargets.resolveTargets (apps/server/src/environment/RemoteOpenTargets.ts). The server adds one when something is listening on port 22, or when Tailscale SSH is on. Tailscale HTTPS is only how the desktop reaches the server. It does not by itself create the SSH host. A Mac that is both serving over Tailscale and accepting SSH matches the report. On a machine with neither port 22 nor Tailscale SSH, the target list is empty, so Open in Cursor has no SSH link to build. That is why a click-through on this Mac did not show the URL. The branch above is still the one the report hits.
Fix, after assignment
Teach resolveRemoteOpenState that a saved connection to a server on this computer stays local-exec, same as the built-in environment. The signal is the connection endpoint: loopback, or this machine's own MagicDNS, mDNS, or Tailscale address. A saved connection to a different machine keeps remote-links.
The new cases belong in apps/web/src/remoteOpen.test.ts: a desktop bearer connection to this machine stays local-exec even when remote-open hosts are advertised, and a bearer connection to another machine still builds the SSH URL.
Same bug on Linux and on Windows, with the desktop app as a client of a t3 server on the same machine and Local environment turned off.
Linux (CachyOS, desktop AppImage nightly, server 0.1.7-nightly.20261102.4093)
The server runs as the systemd --user unit t3code.service with T3CODE_HOME=~/.t3, the same home the desktop app uses.
~/.t3/userdata/desktop-settings.json has "localEnvironmentEnabled": false. sshd listens on :22, and Tailscale Serve is on.
The service is added to the desktop app as a saved connection. Open in builds an SSH link back to this same laptop instead of launching the editor locally.
Windows 11 Pro
The desktop app uses a saved connection to a t3 serve on the same PC, bound to 0.0.0.0:3773, with Local environment off.
Open in Zed builds zed://ssh/<user>@<pc>.<tailnet>.ts.net/P:/..., so Zed SSHes into the PC it is running on.
It did this with the server run by a Windows service wrapper and with an earlier custom launch setup.
Two open PRs target this. #21661 matches the Linux setup above: the service's ~/.t3/userdata/environment-id exists and equals the environment ID that server reports to clients, so the desktop's home ID check would match. #25247 covers a saved route to a loopback address. I have not run either PR's build on these machines.
Fixed by #21661, now on main: With Local environment off and the saved service sharing the desktop's T3 home, Open in Cursor now launches the folder locally instead of opening an SSH link back to the same computer.
Activity
watashiwaaniket commentedon Oct 27, 2026
I'd like to take this. Please assign it to me (@watashiwaaniket). I won't open a PR until it's assigned.
What the code does
Open in Cursor picks a mode in
resolveRemoteOpenState(apps/web/src/remoteOpen.ts), thenOpenInPicker.tsxeither asks the server to launch the editor or opens an SSH URL frombuildRemoteOpenUrl(packages/contracts/src/editor.ts).local-execis only returned for:local:A saved connection is a bearer target. It is neither of those, and the function never checks whether that server is this computer. If
serverConfig.remoteOpenTargetsis non-empty, the first host becomesremote-links, and Cursor getscursor://vscode-remote/ssh-remote+<host>/<path>.Those targets come from
RemoteOpenTargets.resolveTargets(apps/server/src/environment/RemoteOpenTargets.ts). The server adds one when something is listening on port 22, or when Tailscale SSH is on. Tailscale HTTPS is only how the desktop reaches the server. It does not by itself create the SSH host. A Mac that is both serving over Tailscale and accepting SSH matches the report. On a machine with neither port 22 nor Tailscale SSH, the target list is empty, so Open in Cursor has no SSH link to build. That is why a click-through on this Mac did not show the URL. The branch above is still the one the report hits.Fix, after assignment
Teach
resolveRemoteOpenStatethat a saved connection to a server on this computer stayslocal-exec, same as the built-in environment. The signal is the connection endpoint: loopback, or this machine's own MagicDNS, mDNS, or Tailscale address. A saved connection to a different machine keepsremote-links.The new cases belong in
apps/web/src/remoteOpen.test.ts: a desktop bearer connection to this machine stayslocal-execeven when remote-open hosts are advertised, and a bearer connection to another machine still builds the SSH URL.AkiVonAkira commentedon Nov 2, 2026
Note
🤖 Claude Opus 5.5 responding on behalf of Kayzel
Same bug on Linux and on Windows, with the desktop app as a client of a
t3server on the same machine and Local environment turned off.Linux (CachyOS, desktop AppImage nightly, server
0.1.7-nightly.20261102.4093)systemd --userunitt3code.servicewithT3CODE_HOME=~/.t3, the same home the desktop app uses.~/.t3/userdata/desktop-settings.jsonhas"localEnvironmentEnabled": false. sshd listens on:22, and Tailscale Serve is on.Windows 11 Pro
t3 serveon the same PC, bound to0.0.0.0:3773, with Local environment off.zed://ssh/<user>@<pc>.<tailnet>.ts.net/P:/..., so Zed SSHes into the PC it is running on.Two open PRs target this. #21661 matches the Linux setup above: the service's
~/.t3/userdata/environment-idexists and equals the environment ID that server reports to clients, so the desktop's home ID check would match. #25247 covers a saved route to a loopback address. I have not run either PR's build on these machines.juliusmarminge commentedon Nov 11, 2026
Fixed by #21661, now on main: With Local environment off and the saved service sharing the desktop's T3 home, Open in Cursor now launches the folder locally instead of opening an SSH link back to the same computer.