[Bug]: File chips for files created outside the project root fail to open: "Failed to read workspace file 'docs/X.md' in '<root>'"
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 23k
- Forks
- 5.9k
- Avg merge
- 11h 14m
- Merged PRs (30d)
- 357
Description
Area: apps/web
Steps to reproduce:
- Open a project rooted at a directory that is not the folder the agent works in (e.g. project root
~/Documents, agent working inside~/Documents/<subdir>). - Ask the agent to create a file relative to its own cwd, e.g.
docs/GROUPS_PLAN.md. - In the assistant's reply, click the rendered file chip for that file (message text references it as e.g.
docs/GROUPS_PLAN.md:46). - The file preview panel errors instead of opening the file.
Expected behavior:
Clicking the chip opens the file the agent actually created (~/Documents/<subdir>/docs/GROUPS_PLAN.md) in the file preview panel.
Actual behavior:
An error toast and a broken preview panel:
Failed to read workspace file 'docs/GROUPS_PLAN.md' in '/Users/<user>/Documents'.
/Users/<user>/Documents/docs/GROUPS_PLAN.md:46
Impact: Minor bug or occasional failure
Version or commit: 0.0.34-nightly.20260825.1180 (99960383d094)
Environment: macOS 26.6.2, T3 Code desktop app 0.0.34-nightly.20260825.1180, OpenCode provider
Logs or stack traces:
[projects.readFile] ProjectReadFileError {
cwd: "/Users/<user>/Documents",
relativePath: "docs/GROUPS_PLAN.md",
failure: "operation_failed",
operation: "realpath-target",
operationPath: "/Users/<user>/Documents/docs/GROUPS_PLAN.md",
}
Workaround: Open the file via the Files explorer instead of the chip.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in apps/web by tracing rendered file chips to the file preview panel and the projects.readFile operation. Reproduce the issue with different project roots and agent working directories, then verify that clicking a chip opens the file created in the agent's cwd rather than resolving it only from the project root.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- desktop, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100