You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(server): agents can reach every folder a .code-workspace lists - #334
Agents can now reach every folder a project's .code-workspace lists, not only the git repos.
The server reads the .code-workspace when a provider session starts. Listed folders that exist and are not repositories become the session's plain folders. There is no new column and no migration.
Claude and Codex get the plain folders outside the session's working directory through the existing extra-roots mechanism. repoRoots is untouched, so git surfaces and checkpoints behave as before.
Every provider gets a <project_folders> block in its instructions naming the plain folders. In an isolated run it adds one sentence: the folders are the originals, shared with other runs, and outside checkpoints.
If the file cannot be read, the session starts with the repos only and the server logs a warning.
A change to the file applies on the next session start.
docs/user/project-settings.md gains a short section on this.
A listed folder inside a repo root counts as part of that repo, so an isolated run keeps using the worktree for it.
Why
Follow-up 4 (agent half) from the review of #325 on #323. The files panel and @ search offered every listed folder, but the agent was only given repoRoots. A listed folder outside the workspace folder was never granted, and in an isolated run no plain folder was, so an @ reference could point the agent at a path it had to ask for or could not write.
Not covered here: plain folders are outside checkpoints and the diff panel, a recovered session is rebuilt from its working directory alone (the same gap repos have today), and Codex's sandbox may still block writes outside its working directory.
UI Changes
Before (995120e) on the left, this branch on the right. The workspace lists the repo api, the plain folder docs, and ../outside-notes. Both threads run Claude in Supervised mode, where reading outside the granted directories asks first.
Current checkout: read a file in ../outside-notes. Left asks for a file read approval. Right answers.
New worktree: read a file in docs, which sits beside the repo and not in its worktree. Left asks again. Right answers.
A workspace-file project only handed the agent its repo roots, so a listed folder that is not a git repository was out of reach when it sat outside the workspace folder, and in every isolated run.
The provider command reactor now reads the .code-workspace when a provider session starts. Listed folders that exist and are not repositories go into the workspace manifest as plain folders. Claude and Codex get the ones outside the session cwd through additionalRoots, and every provider gets them named in the runtime instructions, apart from the repositories. In an isolated run they stay the original folders and the instructions say so. An unreadable file logs a warning and the session starts with its repositories only.
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🟡 Changes recommended
Incomplete repository-overlap detection can expose original checkouts during isolated runs, and the documentation overstates which folders bypass checkpoints.
Clarify warning to apply only to folders outside repositories
docs/user/project-settings.md:111
This warning is inaccurate for a listed subfolder inside a repository: the manifest deliberately treats it as part of that repository, so an isolated thread uses the worktree copy and checkpoints do cover it. Qualify this as folders outside repositories so users are not incorrectly told those edits are shared and unrevertible.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:Lvouch:trustedPR author is trusted by repo permissions or the VOUCHED list.
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
Agents can now reach every folder a project's
.code-workspacelists, not only the git repos..code-workspacewhen a provider session starts. Listed folders that exist and are not repositories become the session's plain folders. There is no new column and no migration.repoRootsis untouched, so git surfaces and checkpoints behave as before.<project_folders>block in its instructions naming the plain folders. In an isolated run it adds one sentence: the folders are the originals, shared with other runs, and outside checkpoints.docs/user/project-settings.mdgains a short section on this.A listed folder inside a repo root counts as part of that repo, so an isolated run keeps using the worktree for it.
Why
Follow-up 4 (agent half) from the review of #325 on #323. The files panel and
@search offered every listed folder, but the agent was only givenrepoRoots. A listed folder outside the workspace folder was never granted, and in an isolated run no plain folder was, so an@reference could point the agent at a path it had to ask for or could not write.Not covered here: plain folders are outside checkpoints and the diff panel, a recovered session is rebuilt from its working directory alone (the same gap repos have today), and Codex's sandbox may still block writes outside its working directory.
UI Changes
Before (995120e) on the left, this branch on the right. The workspace lists the repo
api, the plain folderdocs, and../outside-notes. Both threads run Claude in Supervised mode, where reading outside the granted directories asks first.../outside-notes. Left asks for a file read approval. Right answers.docs, which sits beside the repo and not in its worktree. Left asks again. Right answers._Video:
compare.mp4