Skip to content

Clicking Foo.tsx:42 fails when the file isn't at the workspace root #6292

Description

@Brechard

Clicking a file reference an agent wrote, like ChatView.tsx:3301, fails:

Failed to read workspace file 'ChatView.tsx' in '/Users/me/dev/t3code'.

The :line suffix is what makes the span a link — a bare ChatView.tsx deliberately isn't one. But the filename alone doesn't say where the file is, so resolveMarkdownFileLinkTarget joins it to the workspace root, and that's rarely where it lives. Agents write references in this shape constantly, so a lot of these links are dead.

To reproduce: post a message containing `SomeFile.tsx:42` in a repo where that file isn't at the root, and click the chip.

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