Skip to content

[Bug]: Path links break when a thread's machine differs from the viewing machine, and "open in file manager" can launch a terminal #45793

Not planned

Description

@helpnoob

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 (also apps/server, packages/shared)

Steps to reproduce

Setup: one desktop client on Linux (Arch, Hyprland) linked to a Windows environment. The same synced folder exists on both machines at different paths, each containing spaces, e.g. C:\Synced Folder\Project on Windows and /home/<user>/Synced Folder/Project on Linux.

  1. From the Linux client, open a thread that runs on the Windows environment.
  2. Have the agent list each output file for both machines, e.g.
    • Windows: `C:\Synced Folder\Project\out.pdf`
    • Linux: [out.pdf](/home/<user>/Synced Folder/Project/out.pdf)
  3. Look at the rendered reply, then try to open the folder in the file manager on the Linux machine.

Expected behavior

  • A path that belongs to the machine I'm viewing from is a working link. Opening, revealing and "open in file manager" act on that machine, even when the thread runs on another machine.
  • A path on another machine is either mapped to a known equivalent folder on this machine or shown as plain text with a short reason. It is never a dead link.
  • A Markdown link whose destination is an absolute path with spaces renders as a link.
  • "Open in file manager" uses the file manager this machine actually prefers, and never a terminal emulator. A terminal-based file manager opens inside the user's terminal at that directory. The UI shows which app will be used, and a per-machine setting can override the choice.

Actual behavior

  • [name](/abs/path with spaces/file.pdf) renders as raw Markdown. In CommonMark a link destination without angle brackets ends at whitespace, and extractMarkdownLinkHrefs (packages/shared/src/markdownLinks.ts) stops there too.
  • Auto-linking is purely syntactic. Every absolute path is resolved against the thread's environment, so a Linux path in a code span becomes a chip pointing at the Windows host, where it does not exist.
  • Open and reveal actions on file chips need remoteOpen.mode === "local-exec" (canUseMarkdownFileShellActions), so paths on the viewing machine get no open action when the thread is remote.
  • Projects only group across machines by git remote, so two copies of a non-git synced folder never relate, and no path mapping is possible (related: [Bug]: Desktop and mobile disagree on which machines a non-Git project is on #45745).
  • On Linux, opening a folder goes through xdg-open after checking that xdg-mime query default inode/directory returns something (apps/server/src/process/externalLauncher.ts). There is no file-manager setting and no compositor-aware detection, and on a Hyprland setup this launched a terminal emulator instead of the configured file manager. Directory chips in chat open in the preferred editor, and the reveal label is generic ("Files") rather than the real app.

Impact

Major degradation or frequent failure

Version or commit

T3 Code (Beta) 0.1.13 desktop

Environment

Windows 11 host environment; Arch Linux + Hyprland desktop client

Workaround

Wrap path destinations in <…>, or copy the path by hand and open it manually.

Planned fix (separate PRs, each referencing this issue)

  1. Parse [text](/abs/path with spaces.ext) leniently when the destination is clearly an absolute file path.
  2. Per-machine file-manager preference: an explicit setting, then compositor bindings (Hyprland), then the OS default directory handler, then xdg-open. Terminal emulators are never picked as the file manager, a terminal-based file manager runs inside the user's terminal, and the resolved app is shown in tooltips and settings.
  3. Decide which machine each path belongs to, send opens to the viewing machine when the path lives there, map paths between linked copies of the same folder, and show a clear non-link otherwise.

Related: #26685, #30285, #45745

Activity

  1. juliusmarminge commented on Nov 30, 2026

    @juliusmarminge
    Member

    I tried to reproduce this on the current build and could not.

    Commit c16ad0c (origin/main). I did not run the app itself. I ran the shared chat Markdown pipeline that the renderer uses (remark-parse + CHAT_MARKDOWN_REMARK_PLUGINS + remark-rehype + CHAT_MARKDOWN_REHYPE_PLUGINS) on [out.pdf](/home/me/Synced Folder/Project/out.pdf). It produced no element, so the text renders as raw Markdown. extractMarkdownLinkHrefs on the same input returns [] where it should return the path. Both are failing tests on branch factory/repro-45793 (f65eef7), in packages/shared/src/markdownLinks.test.ts and markdownPipeline.test.ts. Not reproduced: the cross-machine parts (a Linux client linked to a Windows environment, paths resolved against the thread's environment, open and reveal gated on remoteOpen.mode === 'local-exec' in canUseMarkdownFileShellActions) and the Hyprland xdg-open launching a terminal. Those need two linked machines plus a Hyprland session with the reporter's mime and handler setup, and I could not set that up in this run.

    Closing as not planned. If it still happens for you, reply with the exact steps and the version you are on and it will be looked at again.

  2. helpnoob commented on Nov 30, 2026

    @helpnoob
    Author

    Note

    🤖 Claude Opus 5.5 responding on behalf of helpnoob

    Thanks for looking. Your run did reproduce the first part: the failing tests on factory/repro-45793 show [out.pdf](/home/me/Synced Folder/Project/out.pdf) producing no <a>, and extractMarkdownLinkHrefs returning []. That part is now covered by #40895, and I've closed nothing else on my side. #45801 was correctly closed as its duplicate.

    The rest needs two machines, so here are exact steps. Version: T3 Code (Beta) 0.1.13 desktop on both machines.

    Paths on the viewing machine, when the thread runs elsewhere

    1. Machine A: Linux desktop app. Machine B: Windows, linked to A in Settings → Environments.
    2. On B, add a project at C:\Shared\Project (a plain folder, not a git repo). The same synced folder exists on A at /home/<user>/Shared/Project. Project settings → Checkouts lists only B's checkout, because cross-machine grouping needs a git remote.
    3. From A, open a thread on B and have the agent reply with `/home/<user>/Shared/Project/out.pdf` (a code span, so the Markdown fix doesn't matter here).
    4. Actual: it renders as a file chip, resolved against B, where the path doesn't exist. It has no open or reveal action, because canUseMarkdownFileShellActions requires remoteOpen.mode === "local-exec". Expected: the path belongs to A, the machine I'm viewing from, so it should open there, or else show as plain text with a reason. It should never be a dead chip.

    File manager on Hyprland

    1. On a Hyprland session (Omarchy), the file-manager shortcut launches a terminal-based file manager through $fileManager.
    2. In T3 Code, use Reveal or open a directory with the file-manager editor.
    3. Actual: externalLauncher.ts only goes through xdg-open / inode/directory. There is no file-manager setting and no compositor-aware detection, so it opens the xdg default, which on this machine is a terminal emulator, not the file manager.

    #45811 (file manager) and #45818 (cross-machine paths) implement these two parts with tests. Could you reopen this issue for those two parts? If you'd rather keep one problem per issue, I'm happy to split them into two issues and point each PR at its own. I can also send the quoted-title test rows from #45801 to #40895 if that's useful.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions