Skip to content

[Bug]: File links outside the workspace do not open in the right panel #9278

Description

@JStaRFilms

This was generated by AI during triage.

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. Open a thread whose workspace is one directory.
  2. Ask the agent to read a text or Markdown file at an absolute path outside that workspace.
  3. Have the agent cite the file in its response, for example C:/other-project/XYZ.md:35.
  4. Click the rendered file link.

Expected behavior

The file opens at the cited line in the right-hand file preview, just like a file inside the current workspace.

Actual behavior

The click falls back to the preferred external editor because the link has no workspace-relative path. When no editor is available, T3 Code shows:

Unable to open file
No available editor can open C:/other-project/XYZ.md:35 ...

The user is offered a copy action instead of seeing the file in the right-hand panel.

Technical investigation

resolveMarkdownFileLinkMeta intentionally sets workspaceRelativePath to null for absolute paths outside cwd. MarkdownFileLink.handleOpenInFilePreview treats that as a reason to call handleOpenInEditor() rather than onOpenInPanel(...).

The right-panel file surface currently stores only a workspace-relative path, and ChatView always supplies the active workspace root to FilePreviewPanel. Supporting this safely requires the file surface to retain the root used for the selected file, so the existing workspace file API can still receive a relative path and preserve traversal/symlink checks.

Acceptance criteria

  • Clicking a text/Markdown file reference outside the current workspace opens it in the right-hand file preview.
  • A cited line is revealed.
  • Existing in-workspace links behave unchanged.
  • External-editor actions remain available as secondary actions where supported.
  • Existing relative traversal and symlink escape protections remain unchanged.

Related issues

Activity

  1. JStaRFilms commented on Sep 2, 2026

    @JStaRFilms
    Author

    This was generated by AI during triage.

    This was already implemented by #9140 and is present on current main. That merged change makes outside-workspace text/Markdown files open read-only in the right-hand file panel at the cited line, while preserving workspace-only writes. I initially missed it because the first GitHub search was limited to open issues/PRs and the local checkout predated the merge. Closing this duplicate.

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