Skip to content

[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

Closed

Description

@althafdemiandra

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. On a Mac, run the server as a background service separate from the desktop app (t3 serve, bound to 0.0.0.0:3773, Tailscale Serve enabled).
  2. In the desktop app, turn off the built-in local environment and connect to that service as a saved connection.
  3. Open any thread and choose Open in Cursor.

Expected behavior

Cursor opens the folder directly on this Mac, the same way it does for the desktop app's built-in local environment.

Actual behavior

T3 opens a cursor://vscode-remote/ssh-remote+<host>/<path> link, so Cursor asks to connect to this same Mac over SSH.

Impact

Minor bug or occasional failure

Version or commit

Desktop: T3 Code (Nightly). Server: 0.1.3-nightly.20261027.3748.

Environment

macOS 27.2 m4 mac mini

Logs or stack traces

Screenshots, recordings, or supporting files

file-a0aea8660b6bdf84327eaa3ae328c42b.png

Workaround

No response

Activity

  1. added
    bugSomething is broken or behaving incorrectly.
    needs-triageIssue needs maintainer review and initial categorization.
    on Oct 27, 2026
  2. watashiwaaniket commented on Oct 27, 2026

    @watashiwaaniket

    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.

  3. AkiVonAkira commented on Nov 2, 2026

    @AkiVonAkira
    Contributor

    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 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.

  4. juliusmarminge commented on Nov 11, 2026

    @juliusmarminge
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken or behaving incorrectly.needs-triageIssue needs maintainer review and initial categorization.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions