Skip to content

Repo-relative file links in multi-repo threads resolve against the workspace root and fail to open #302

Description

@dotrahat

Symptom

In a multi-repo project whose workspace root is a parent folder, clicking a repo-relative file path in an agent reply opens the preview panel with an error:

Failed to read workspace file '.graft/config.json' in '/home/cvl'.
Image

The file exists, but at /home/cvl/unitree_sim_isaaclab/.graft/config.json, one level down in a repo root.

T3 Code 0.0.42 (Linux AppImage), built from multi-repo-workspaces @ 1d386b99a, local environment.

Repro

  1. Have a project with workspace root /home/<user> and repo roots /home/<user>/<repo-1>, /home/<user>/<repo-2>, and three more.
  2. Ask the agent about uncommitted changes in one repo. It runs cd /home/<user>/<repo-1> && git status and writes the path as `.graft/config.json`.
  3. Click the file chip for that path.
  4. The preview reads /home/<user>/.graft/config.json, which does not exist.

Cause

In a chat message, a relative path resolves against the workspace root, not against a repo root:

  • resolveMarkdownFileLinkTarget joins the relative path onto the workspace root (apps/web/src/markdown-links.ts:83).
  • buildFileLinkMetaFromTarget then looks for the repo that contains the resulting path (markdown-links.ts:146). /home/cvl/.graft/config.json is not inside any repo root, so the preview reads from the workspace root (FilePreviewPanel.tsx:958).

The path is also ambiguous: .graft/config.json can exist in multiple repo roots (<repo-1> and <repo-2>).

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions