When using a .code-workspace file with multiple folders, the agent treats files inside workspace folders as “external” and prompts “Allow all edits in [directory]”.
Steps to Reproduce
Steps to reproduce:
Open a .code-workspace file with multiple folder entries
Start an agent chat that edits files in one of the workspace folders
The agent prompts for “Allow all edits in…” even though the file is inside a workspace folder
Expected Behavior
Expected: Files inside any folder defined in the .code-workspace should be considered internal and not trigger the external file edit protection prompt.
Actual: The prompt appears as if the file is external.
Example: workspace defines my-project as a folder, but editing a file under my-project/service/internal/util/ triggers the external edit prompt.
This is a confirmed bug with multi-root workspaces. When folders are added to an existing .code-workspace, the workspace metadata isn’t updated to include them, so the agent treats files in those folders as “external” and triggers the approval prompt.
Our team is aware and working on a fix.
Workaround: Copy your .code-workspace file to a new filename (keeping the same folder entries), then open the copy. This resets the internal workspace identifier and forces fresh metadata, which should resolve the approval prompts for all folders. Not ideal if you have tooling tied to the original filename, but it unblocks things in the meantime.
You can use the notification bell at the bottom of this thread (set it to “Watching”) – that way you’ll get notified when we post an update here. We’ll follow up on this thread once the fix ships.
Following up here! We’ve shipped changes to how the agent tracks folders in multi-root workspaces since you posted. Could you update to the latest version and give it another try? Quick check:
Open your .code-workspace with multiple folder entries
Start an agent chat that edits files in one of the workspace folders
Confirm the “Allow all edits in…” prompt no longer appears for files inside workspace folders
Let me know if the prompt still shows up, otherwise updating should have you covered.