VSCode Codex doesn't respect sandbox_workspace_write.writable_roots in config.toml
Resolved 💬 4 comments Opened Dec 15, 2025 by yiteng-guo Closed Dec 16, 2025
💡 Likely answer: A maintainer (gpeal, contributor)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
codex-cli 0.72.0
What subscription do you have?
azure foundry
Which model were you using?
gpt-5.2
What platform is your computer?
_No response_
What issue are you seeing?
I think vscode-codex overwrites the sandbox_workspace_write.writable_roots with the current project dir so it doesn't respect the one in config.toml
What steps can reproduce the bug?
In vscode-codex extension (version 0.4.51), asking codex
> what's your sandbox_workspace_write.writable_roots value?
sandbox_workspace_write.writable_roots is:
- /path/to/the_current_project_opened_in_vscode
even if in config.toml, I set
[sandbox_workspace_write]
writable_roots = ["/path/to/my_other_project"]
If you run codex cli in the current project dir and ask them the same question, it responds
• writable_roots is:
- /path/to/my_other_project
What is the expected behavior?
vscode-codex should behave in the same way as codex cli.
Additional information
_No response_
4 Comments
This is correct, the extension users your open workspace folders as writable roots
hi, I should add a bit more context here. I have git worktree setup such that
For any git operation I need to perform in
project-worktree1, it needs to modify the main git repo../project/.git/worktrees/project-worktree1/index. codex sandbox doesn't allow this so I have to whitelist.../project/.gitto get this work.This works in codex cli because cli includes both
sandbox_workspace_write.writable_rootsand the current working directory instead ofoverwritingit. However, this doesn't work in vscode-codex since it only includes the current working directory. I believe the cli behavior is correct where the current working directory should be appended towritable_rootsinstead of overridingwritable_roots.Fwiw, you also have this type of issue in non-git-worktree use case if you ever want to modify any file in a folder outside the workspace (e.g. a special tmp dir, some configuration dir, and etc)
Finally, I'd argue that the docs https://developers.openai.com/codex/local-config/ says additional writable roots so vscode-codex shouldn't override it. If you do still believe the current behavior is correct, I'd like to know how to handle the git worktree use case as I described above.
Thanks for the additional info, I'll take this back to the team for further discussion.
nvm - I found this #5041. I was just under the impression that vscode-codex reads
~/.codex/config.tomlsimilar to many other users in that thread. The custom mode works for me. It would be nice if you can add that custom mode to the documentation here https://developers.openai.com/codex/ide