Codex edit/apply crashes on Windows in VS Code Insiders with codex-command-runner.exe error 0xc0000022
What version of the IDE extension are you using?
26.5311.21342
What subscription do you have?
Plus
Which IDE are you using?
VS Code
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
Any time Codex tries to edit a file in VS Code Insiders on Windows, the edit fails and Windows shows:
codex-command-runner.exe - Application Error
The application was unable to start correctly (0xc0000022).
This appears specific to Codex edit/apply. Manual editing works, and GitHub Copilot Chat can edit the same file successfully.
What steps can reproduce the bug?
Open VS Code Insiders
Open any file
Ask Codex to make a tiny edit
Codex attempts to apply the patch
Crash dialog appears for codex-command-runner.exe
No edit is applied
What is the expected behavior?
_No response_
Additional information
Any time Codex tries to edit a file in VS Code Insiders on Windows, the edit fails and Windows shows:
codex-command-runner.exe - Application ErrorThe application was unable to start correctly (0xc0000022).
This appears specific to Codex edit/apply. Manual editing works, and GitHub Copilot Chat can edit the same file successfully.
Environment:
- Windows
- VS Code Insiders
- OpenAI/Codex extension
- Example workspace file:
d:\txData\Qbox_979BCA.base\resources\[gravvy]\gravvy_hookies\test.lua
Repro:
- Open VS Code Insiders
- Open any file
- Ask Codex to make a tiny edit
- Codex attempts to apply the patch
- Crash dialog appears for
codex-command-runner.exe - No edit is applied
What works:
- Manual typing/editing in VS Code
- Copilot edit/apply in the same workspace
- Running these binaries directly from PowerShell:
codex-command-runner.execodex.execodex-windows-sandbox-setup.exe
For example:
codex-command-runner.exe --helpreturnsrunner: no request-file providedcodex.exe --helpworks normally
So the binaries themselves are launchable outside the extension.
What I tried:
- Run VS Code as admin
- Restart VS Code and PC
- Compatibility mode
sfc /scannow- Reinstall extension
- Force redownload of
codex-command-runner.exe - Disable/re-enable sandbox
- Disable WSL
- Clear VS Code Insiders cache/storage:
WebStorageLocal StorageService WorkerCacheCode CacheSession Storage- Remove legacy Codex config:
``toml``
[windows]
sandbox = "elevated"
and restart so Codex rebuilds sandbox setup
None of the above fixed it.
Relevant logs:
- Latest Codex log:
C:\Users\jt614\AppData\Roaming\Code - Insiders\logs\20260314T212606\window1\exthost\openai.chatgpt\Codex.log
Notable log behavior:
- Codex activates and spawns app-server
- Logs unsupported internal requests such as:
local-environments is not supported in the extension- previously also
open-in-target not supported in extension
This makes it look like the failure is in the Codex extension’s edit/apply integration path on Windows, not in the workspace files themselves.
Binary paths involved:
C:\Users\jt614\.codex\.sandbox-bin\codex-command-runner.exeC:\Users\jt614\.vscode-insiders\extensions\openai.chatgpt-26.5311.21342-win32-x64\bin\windows-x86_64\codex-command-runner.exeC:\Users\jt614\.vscode-insiders\extensions\openai.chatgpt-26.5311.21342-win32-x64\bin\windows-x86_64\codex.exeC:\Users\jt614\.vscode-insiders\extensions\openai.chatgpt-26.5311.21342-win32-x64\bin\windows-x86_64\codex-windows-sandbox-setup.exe
Expected:
Codex should apply file edits normally.
Actual:
Only Codex edits crash with codex-command-runner.exe 0xc0000022; manual edits and Copilot edits succeed.
5 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Having this exact same issue
EDIT: I asked codex to rollback the extension to a week-old version and that seemed to do the trick for now
Install Codex for Win -> Signout -> Re-Sign in -> Setup sandbox
When it finished, codex on VScode also re-worked
あくまで私のパターンですが、何かのヘルプになれば幸いです。
I resolved this issue. The root cause was abnormal ACL settings on the system runtime libraries C:\Windows\System32\vcruntime140.dll and C:\Windows\System32\msvcp140.dll: they were missing BUILTIN\Users:(RX). As a result, Codex's sandbox users could not read these DLLs, and startup failed with 0xc0000022. After restoring read and execute permission on those two DLLs, command execution started working again. This may not be the only possible cause, but I’m sharing it here in case it helps others.
Thanks for the help, @Xubing-online !
I've resolved this issue on my machine (Windows 10 Professional Edition). If you are encountering the 0xc0000022 (Access Denied) error while using the plugin in "Default Permission" mode (but "Full Permission" works fine), the root cause might be abnormal ACL settings on your system runtime libraries.
In "Default Permission" mode, Codex runs commands (like rg) within a sandboxed/restricted environment. This environment typically inherits privileges from the Users group. If critical system DLLs in C:\Windows\System32 are missing the Users group in their Access Control List (ACL), the sandbox will fail to load them, leading to the 0xc0000022 crash.
You need to ensure that the Users group has at least Read & Execute permissions for the Visual C++ Redistributable DLLs.