Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate of this error-reporting problem.
- I included enough detail to reproduce or investigate the problem.
Area
apps/web (also desktop, which uses the web file preview); packages/contracts and apps/server supply the error.
Problem
When a chat file link points to a missing or malformed path, the Files panel only reports Failed to read workspace file '<relative path>' in '<workspace>'. It does not show the full path attempted or explain whether the failure was a missing file, a permission problem, or another read error. Users cannot readily distinguish a bad agent-authored link from a T3 file-preview failure.
Steps to reproduce
- Open a project whose workspace root is
/Users/<user>/CMU/33120. - Create
film-critique/outline.mdinside that workspace. Ensure there is no nested33120/film-critique/outline.md. - Have an assistant message contain
[outline.md](33120/film-critique/outline.md)and click the rendered file chip. - The link resolves to
/Users/<user>/CMU/33120/33120/film-critique/outline.md, and the read fails.
Expected behavior
The preview error should show the full attempted path and the underlying reason when known. For example, for a confirmed missing-file error:
File not found
/Users/<user>/CMU/33120/33120/film-critique/outline.md
Relative file links are resolved from /Users/<user>/CMU/33120.
Check the link's path or locate the file in Files.
If a likely duplicated workspace prefix is highlighted, present it as a possible path mistake rather than claiming the intended file is known. Permission and other read failures should retain their own explanations.
This issue is scoped to informative errors. Automatic path rewriting or fallback file selection can be considered separately.
Actual behavior
The screenshot supplied with the report shows only:
Failed to read workspace file '33120/film-critique/outline.md' in '/Users/<user>/CMU/33120'.
The breadcrumb repeats 33120, but there is no explanation of the attempted absolute path or underlying failure.
Impact
Minor bug or occasional failure. A malformed link leaves users unsure what failed and how to open the file.
Version or commit
Screenshot's release version is unknown. Source investigated at bd89c1302026255c62cc09278207bfaf2664da4a.
Environment and evidence
The supplied screenshot uses a macOS workspace path; exact client/version and connection mode are unknown. Executing the current link resolver with the example inputs reproduced the duplicated absolute path. The original message and actual file location on the Mac were not available, so the original filesystem failure reason remains unconfirmed. No browser verification was performed.
Investigation pointers
ProjectReadFileErrorcarries structured context such asresolvedPath,operation, andoperationPath, but its fallback message only includes the relative path and workspace.projectFilesQueryState.tsreduces the read error to a message string;FilePreviewPanel.tsxrenders that string.- Apply shared error improvements consistently to web/desktop and any mobile consumers of the same read-file contract. Display paths from the connected environment.
Related path-resolution reports: #8251 and #10553. This report concerns diagnosing failed reads, independently of how links are resolved.
Workaround
Locate the file in Files, or ask the agent for an absolute path or a correctly workspace-relative link such as film-critique/outline.md.
Activity
juliusmarminge commentedon Sep 30, 2026
Note
Grok responding on behalf of Julius.
Triage
Confirmed on
bd89c130. The server already tells the preview which path it tried and why the read failed, but the preview throws that away and shows only the generic message. This isn't a duplicate of #8251 or #10553 (both open issues). The fix here should be a better error message, not rewriting the path.projects.readFilereturns aProjectReadFileErrorwithfailure,operation,operationPath, andresolvedPath. A missing workspace file comes back asfailure: "operation_failed"withoperation: "realpath-target", and the joined absolute path is on bothresolvedPathandoperationPath. The publicmessageis onlyFailed to read workspace file '<relative>' in '<cwd>'.on purpose. The constructor andpackages/contracts/src/project.test.tskeep the underlying cause out of the message so raw platform error text never reaches the user.The Files panel then drops everything else.
useProjectFileQuerykeeps onlycause.messageand special-casesfailure === "path_not_file"so a directory opens the tree.FilePreviewPanelrenders that one string. Desktop uses the same preview. Mobile doesn't show this read error at all.Suggested fix:
resolvedPathoroperationPath.path_not_file,binary_file,workspace_path_outside_root,resolved_path_outside_root, and a generic read failure.cause.message.operation_failedwithrealpath-targetas "file not found". The same operation also covers permission errors and otherrealpathfailures.ProjectFileFailurevalue would need a clear compatibility plan for older clients.A hint about a duplicated workspace prefix would be a nice extra, but it should be worded as a possible mistake in the link, and the preview shouldn't open a different file. Opening the chip at a different path is what #8251 and #10553 cover. Open PR #8254 only changes slash-path lookup and doesn't touch this error.