Codex edit/apply crashes on Windows in VS Code Insiders with codex-command-runner.exe error 0xc0000022

Open 💬 5 comments Opened Mar 15, 2026 by yukisho
💡 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?

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

Environment:

  • Windows
  • VS Code Insiders
  • OpenAI/Codex extension
  • Example workspace file: d:\txData\Qbox_979BCA.base\resources\[gravvy]\gravvy_hookies\test.lua

Repro:

  1. Open VS Code Insiders
  2. Open any file
  3. Ask Codex to make a tiny edit
  4. Codex attempts to apply the patch
  5. Crash dialog appears for codex-command-runner.exe
  6. 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.exe
  • codex.exe
  • codex-windows-sandbox-setup.exe

For example:

  • codex-command-runner.exe --help returns runner: no request-file provided
  • codex.exe --help works 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:
  • WebStorage
  • Local Storage
  • Service Worker
  • Cache
  • Code Cache
  • Session 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.exe
  • C:\Users\jt614\.vscode-insiders\extensions\openai.chatgpt-26.5311.21342-win32-x64\bin\windows-x86_64\codex-command-runner.exe
  • C:\Users\jt614\.vscode-insiders\extensions\openai.chatgpt-26.5311.21342-win32-x64\bin\windows-x86_64\codex.exe
  • C:\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.

View original on GitHub ↗

5 Comments

github-actions[bot] contributor · 5 months ago

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

  • #14448
  • #14211
  • #13965
  • #13959

Powered by Codex Action

BrettMCoding · 5 months ago

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

EB-Y-Onishi · 5 months ago

Install Codex for Win -> Signout -> Re-Sign in -> Setup sandbox
When it finished, codex on VScode also re-worked

あくまで私のパターンですが、何かのヘルプになれば幸いです。

Xubing-online · 4 months ago

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.

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

  1. Navigate to C:\Windows\System32.
  2. Locate vcruntime140.dll and msvcp140.dll.
  3. For each file: Right-click -> Properties -> Security -> Edit.
  4. Check if the Users group exists. If not, click Add, type Users, and click OK.
  5. Ensure "Read & Execute" and "Read" are allowed for the Users group.