apply_patch points to WindowsApps codex.exe, causing "Access is denied" on Windows
What version of the Codex App are you using (From “About Codex” dialog)?
26.609.41114
What subscription do you have?
ChatGPT Plus
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
Summary
apply_patch is unusable in my Codex Desktop environment on Windows.
The wrapper exists and is found in PATH, but it points to an old codex.exe under C:\Program Files\WindowsApps\..., and invoking it fails with Access is denied.
At the same time, a newer Codex CLI binary exists under C:\Users\<USER>\AppData\Local\OpenAI\Codex\bin\... and works correctly, including --codex-run-as-apply-patch.
This means the Desktop/runtime is still generating a stale apply_patch.bat that targets the wrong executable.
Environment
- OS: Windows 11
- Codex Desktop runtime appears to launch from
WindowsApps - Current date observed: 2026-06-16
What I expected
apply_patch should invoke the current working Codex binary and apply patches normally.
What happened
apply_patch resolves successfully, but execution fails because the generated wrapper points to an old WindowsApps path.
Reproduction details
Get-Command apply_patch shows:
Source : C:\Users\<USER>\.codex\tmp\arg0\codex-arg0WOzis3\apply_patch.bat
Definition : C:\Users\<USER>\.codex\tmp\arg0\codex-arg0WOzis3\apply_patch.bat
CommandType : Application
### What steps can reproduce the bug?
1. Install or reinstall Codex Desktop on Windows.
2. Launch Codex Desktop and open a thread/workspace.
3. In the Codex environment, run Get-Command apply_patch and inspect the generated wrapper.
4. Observe that apply_patch.bat points to C:\Program Files\WindowsApps\...\codex.exe.
5. Try invoking apply_patch with even an empty/minimal patch.
6. Observe that it fails with Access is denied.
### What is the expected behavior?
apply_patch should invoke the currently active Codex runtime and apply the patch successfully. After reinstalling or restarting Codex Desktop, the generated apply_patch wrapper should point to the current working Codex binary, not a stale WindowsApps path.
### Additional information
_No response_This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗