Agent mode requests unnecessary approval for edits inside secondary workspace folders
What version of the VS Code extension are you using?
0.4.39
What subscription do you have?
ChatGPT Plus
Which IDE are you using?
VS Code
What platform is your computer?
Darwin 25.1.0 x86_64 i386
What issue are you seeing?
When using Codex in Agent mode within a multi-root Workspace, the extension incorrectly asks for approval to apply edits (showing the “Allow once / Allow this session / Reject” dialog) — even though the files being modified are inside folders that are part of the Workspace.
<img width="498" height="831" alt="Image" src="https://github.com/user-attachments/assets/28ae304d-3bb2-4b90-84a9-b04278cccae2" />
This happens even though Agent mode is supposed to allow automatic edits within the entire workspace, according to the extension’s description.
What steps can reproduce the bug?
- Create a multi-root Workspace in VS Code (with at least two folders added).
- Open the Codex extension and select Agent mode.
- Ask Codex to edit a file located in any folder other than the first one in the Workspace.
- Codex will attempt to apply the edit but display a prompt asking for approval (“Allow once / Allow this session / Reject”).
- Now ask Codex to edit a file from the first folder in the Workspace — it will edit it directly without requesting approval.
What is the expected behavior?
When in Agent mode, Codex should:
- Be able to read and edit files in all folders included in the Workspace.
- Not require approval for edits performed within the Workspace boundaries.
- Request approval only for:
- Files located outside the Workspace
- Network access or external command execution
Additional information
The issue seems related to how Codex determines the working directory in multi-root Workspaces — it appears to only recognize the first folder as the valid working path.
The problem does not occur in single-folder projects.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗