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_

View original on GitHub ↗

14 Comments

github-actions[bot] contributor · 4 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • ##13574
  • ##14729

Powered by Codex Action

etraut-openai contributor · 4 months ago

Please provide the version number of the app that you have installed.

Kingwolf123 · 4 months ago
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

Norway174 · 4 months ago

Can confirm, I have the same issue as well.

VSCode: 1.111.0
Codex extension: 26.5311.21342

The 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: 1

It 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.

pzarzycki · 4 months ago

Codex CLI and Codex Windows app suffers the same way. apply_patch is failing in Default sandbox for some files (often in /src/**). Forces to allow codex full permission.

codex --version
codex-cli 0.114.0
Shen · 4 months ago

Also the same problem:
Codex extension: 26.5313.41514
VSCode: 1.111.0

Wangningsen · 4 months ago

My codex extension 26.313.41514 is also still having this bug

jvvilar · 4 months ago

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.

GitMurf · 4 months ago

@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.

jvvilar · 4 months ago

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.

GitMurf · 4 months ago

@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

Kingwolf123 · 3 months ago

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.

pzarzycki · 3 months ago

Codex sandbox on Windows works terribly. It forces the user to turn on dangerous full permissions often.

Example: I have gh command 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.

GitMurf · 3 months ago
Example: I have gh command authenticated. Codex from sandbox is unable to run it, doesn't request user permissions, even in "auto-guardian" mode.

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).