[Bug]: Not following symlinks to iCloud~Drive, can't read files/see diffs
Before submitting
- [x] I searched existing issues and did not find a duplicate.
- [x] I included enough detail to reproduce or investigate the problem.
Area
apps/desktop
Steps to reproduce
- Symlink any iCloud~Drive folder to a project
- Try reading any of it's contents
Expected behavior
Can read files
Actual behavior
Can't read files and get this error message:
Impact
Major degradation or frequent failure
Version or commit
Latest stable
Environment
macOS 15.5
Logs or stack traces
Screenshots, recordings, or supporting files
No response
Workaround
Need to open files in Obsidian (yes I use obsidian, judge me all you want)
Codex investigation notes: this does not appear to be an exact duplicate, but several closed issues are relevant:
- #4223 documents the workspace containment boundary.
readFilealready rejects symlinks whose canonical target is outside the project root; that issue concerned bringing writes under the same restriction. - #2135 concerns selecting symlinked directories in the add-project picker. Selecting the symlink itself as a project root is supported behavior, but it is different from following a symlink located inside another project.
- #6166 produced the same generic “Failed to read workspace file” message for diff files, but its cause was incorrect repository-relative path translation for a project nested inside a Git repository. #6174 fixed that case.
- #5125 is useful prior art for authorizing an explicitly selected file outside the project root with a short-lived exact-file capability.
The distinct behavior in this report is that the workspace index follows an external directory symlink and lists its contents, while projects.readFile resolves the same path and rejects it as resolved_path_outside_root. The behavior is not specific to iCloud; an ordinary directory symlink that leaves the project root reaches the same containment check.
A safe resolution probably needs either explicit authorization for external symlink targets or consistent filtering and messaging in the workspace index. Simply removing the canonical containment check would allow a project symlink to expose arbitrary files readable by the server process.
I have the same issue - one of the sub-directories in my project is symlinked from a Dropbox directory. I cannot open and view those files in the file view
issue still exists on v0.1.0
Confirmed on a Linux SSH-hosted server as well; this is not specific to iCloud or macOS. I searched the existing issues, discussions and PRs before preparing a fix. This report and #8408 cover the observed failure; discussion #6727 and open PRs #8281 / #21920 are also relevant.
A minimal reproduction, using only disposable directories:
fixture=$(mktemp -d)
mkdir -p "$fixture/project" "$fixture/storage"
printf 'linked report\n' > "$fixture/storage/report.md"
ln -s "$fixture/storage" "$fixture/project/data"
# Add "$fixture/project" as a T3 project, then browse data/report.md.
The server's OS user can list project/data and read project/data/report.md. On current upstream main (dc84b0962efa4f4e05ef392c08986a9cd7c994d1):
filesystem.browseomits the directory link because its Dirent is not a directory.projects.listEntries({cwd: project, directoryPath: ""})omits the link for the same reason; explicitly listingdirectoryPath: "data"rejects its canonical target as outside the workspace.projects.readFile({cwd: project, relativePath: "data/report.md"})fails withresolved_path_outside_root, while reading the same host file by absolute path succeeds.
In the real Linux layout, a home-directory link to projects on a separate data volume made the projects disappear from the picker. Comparing OS listings with the patched service's actual RPC results verified 21 directories (including all 15 readable first-level project directories on that volume) and 17 file previews. No filesystem permission changes or root execution were needed. Those checks were against the deployed fork; the new PR is independently based on current upstream main and has its own regressions and validation.
The proposed fix follows local directory/file links using the server user's existing OS permissions, preserves alias paths, bounds link classification, and suppresses links that would make folder expansion cycle. Workspace writes and external network-target restrictions remain bounded. Allowing relative local symlink reads outside the workspace changes the existing canonical-read containment rule; I am calling that out explicitly for maintainer review, rather than treating it as an already-approved direction. The picker-only and contained-link PRs above do not resolve that part of this report.
Proposed fix: #26044, based directly on the main commit above. Its 43 focused tests and check:changed pass; the PR explicitly calls out the local read-containment policy change for maintainer review.
Another use case for symlinks that point outside the workspace, with no cloud drive involved.
I keep several local git worktrees of the same repo side by side. Each worktree has symlinks to directories that live outside all of them and are shared on purpose: a data directory and a plans/ directory. The agents in every worktree read and write those shared directories, so the links are intentional and are the whole point of the setup.
The agents themselves are already able to follow outside symlinks (everything is in YOLO anyway). So can Cursor launched from T3. What's the purpose intentionally limiting the reach of T3's File Browser?!
In T3 Code these links do not appear in the Files tree at all, so I cannot browse or preview the shared plans next to the code. Treating a link the user created inside the project as part of the project, at least for read and browse, would cover this. #26044 looks like it addresses exactly this.
Same here on v0.1.8 (desktop beta), macOS 27.0.1.
My project has a subfolder that is a symlink to a directory outside the project root. Agents read and write through it fine, but files behind the link can't be opened in the file viewer.
The link is deliberate, so read and browse through it would cover my case.
Another case, and a question for a maintainer before anyone opens a PR again (#26044 was closed for lacking that OK).
Case. A project with projects/customers -> ~/Library/CloudStorage/OneDrive-Org/Customers and projects/partners -> …/Partners, plus a root REPO-INDEX.md linked from a sibling repo. The agents work in those folders every day. The Files tree shows none of the three, so the files the project is about can't be browsed or previewed. Desktop client, remote macOS server, build of 222288b00f.
Containment currently depends on how the path is spelled. On main (1d1489d0b8), all of these need the same AuthFilesystemReadScope:
projects.readFilewith an absolute or~/path reads the host file in place with no root check. Only network paths are checked (WorkspaceFileSystem.resolveReadTarget: "An absolute or~/path reads a host file in place … it gets no root check"). The chat already opens such paths read-only in the right panel (#9140).filesystem.browselists any folder.projects.readFilewithprojects/partners/x.md, the same file reached through a link the user made inside the project, fails withWorkspaceFilePathEscapeError.projects.listEntrieshides the link (#21920) and refuses to list inside it.
So hiding and refusing the link doesn't keep a client with this scope away from any file it can't already read by absolute path. It only hides the user's own links. Writes are a different matter, and #18819's rule for them should stay.
Proposal for a focused fix. listEntries lists and expands a link to a local folder or file outside the root, and readFile reads through it read-only, with the absolute-path rules: network targets refused, .git targets, dangling links and loops hidden. Writes, the search index (#24578) and browse stay as they are. Would a maintainer accept a PR of that scope? We carry it in our own build meanwhile and can open the PR from current main.
Closing as not planned. Workspace-relative reads and folder expansion stay inside the project's real root on purpose, so links that point outside it won't be followed. As a workaround, add the link's real target folder (for example the iCloud Drive folder itself) as its own project.
@juliusmarminge "stay... on purpose" And you still don't explain that purpose?..
Agent harnesses themselves are happy to follow links outside. IDEs (openable from t3code) too. What's so special about t3code's File Browser that it must protect its path harder then the agents themselves do?!!