VS CODE Codex extension : Apply_patch is failing
Open 💬 14 comments Opened Mar 15, 2026 by Kingwolf123
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of the IDE extension are you using?
The latest version
What subscription do you have?
Plus
Which IDE are you using?
VS Code
What platform is your computer?
Windows 11 64Bit Latest
What issue are you seeing?
https://github.com/openai/codex/issues/13574
Same issue as this. Codex is failing apparently to do writes or updates on files.
Please fix.
What steps can reproduce the bug?
Just edit or ask codex to change files / code in VS code extension
What is the expected behavior?
_No response_
Additional information
_No response_
14 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Please provide the version number of the app that you have installed.
VS CODE: 1.111.0
Codex extension for VS CODE : 26.311.21342
Can confirm, I have the same issue as well.
VSCode:
1.111.0Codex extension:
26.5311.21342The error code the AI tells me it's getting when I ask why the edits are rejected;
windows sandbox: setup refresh failed with status exit code: 1It seems to be able to edit files in the root of my project. But fails on any sub-folders.
If I change the Permissions from Default Permissions to Full Access, the it works without errors. Though, I'd rather not give the AI access to my whole system.
Codex CLI and Codex Windows app suffers the same way.
apply_patchis failing in Default sandbox for some files (often in /src/**). Forces to allow codex full permission.Also the same problem:
Codex extension: 26.5313.41514
VSCode: 1.111.0
My codex extension 26.313.41514 is also still having this bug
Codex is borderline unusable on Windows because of the patch tool issue. Wastes loads of tokens trying the tool and going on direct file edits, then failing those edits and trying again.
It's slow, it's wasteful and just a broken product. The customers paying for the most tokens on your most expensive models should probably have this fixed in a timely manner.
@jvvilar et al, I agree! For what its worth, the only "workaround" / fix for now is using the Codex CLI directly and rolling back to v0.113. See my comment here in another similar gh issue: https://github.com/openai/codex/issues/14675#issuecomment-4092786776
Can't use the Codex App for the VScode extension, but can at least use the Codex CLI directly for now.
Can confirm that @GitMurf 's suggestion works. Installed codex v0.113.0 and the patch tool works perfectly in VScode's integrated terminal. Thanks for the tip.
@jvvilar I was able to get a little further in debugging the issue. Here is a workaround that should work with current version of Codex: https://github.com/openai/codex/issues/14675#issuecomment-4101350142
Has this been fixed?
How can codex windows be left without this unpatched / fixed?
This issue makes it practically unusable because i , along with majority of people dont want to risk giving full unabated access to all my PC . Without full access, codex is practically useless for any actual work in VS Code or even using Codex app, for which i believe this bug is also present, and i find that working with it has been untenable
This needs to be fixed ASAP.
Codex sandbox on Windows works terribly. It forces the user to turn on dangerous full permissions often.
Example: I have
ghcommand authenticated. Codex from sandbox is unable to run it, doesn't request user permissions, even in "auto-guardian" mode.At the same time messes with user permissions on the NTFS. There are files in .git/ and node_modules/ I don't have permission to. Forces to run administrative cleanup, etc.
Really frustrating.
Agree... but what I have found is gh (and most other tools that have issues) will work if you tell Codex whenever there is a CLI tool / permission issue to try running using the elevated permissions "tool". I have it in my agents md and it has actually been fairly reliable to follow it. Then when it runs gh for example it is authenticated as my user and works fine.
Very annoying though. And my latest frustration is trying to use worktrees in Codex App because it has git issues and has to add each worktree folder to git config (and they use uuids so has to happen with every worktree).