apply_patch execution failed
Open 💬 2 comments Opened Jun 10, 2026 by wangzhilin777
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of the Codex App are you using (From “About Codex” dialog)?
26.602.40724
What subscription do you have?
plus
What platform is your computer?
WIN10 X64
What issue are you seeing?
After the Codex client was updated, the apply_patch launch path was switched from Windows Apps to AppData\Local\OpenAI\Codex\bin
But the current thread or some residual temporary directory is still holding the old wrapper
As a result, the phenomenon of "the same machine, the same Codex, sometimes it can be used and sometimes it is denied access" appeared
Why is the old entry cache not processed before changing paths?
What steps can reproduce the bug?
fix the problem
What is the expected behavior?
_No response_
Additional information
_No response_
2 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Windows MSIX
apply_patchWorkaroundI found a working workaround for the Windows MSIX version of Codex Desktop.
The problem is that Codex Desktop generates
apply_patch.batwith an absolute path to:That packaged executable returns
Access is deniedwhen launched by an external shell process.Workaround
Set
CODEX_CLI_PATHas a Windows user-level environment variable, before starting Codex Desktop:Then completely exit Codex Desktop, terminate any remaining
codex.exeprocesses, and start Codex again.After restarting, the generated wrapper points to the npm-installed CLI instead:
apply_patchthen works normally. I verified this with a multiline patch that created a file successfully.Important Details
CODEX_CLI_PATHmust be a Windows user-level environment variable inherited by the Codex Desktop process before startup. Setting the same name only inside~/.codex/config.tomlis not sufficient for this fix.This workaround does not modify
WindowsAppsACLs or patch the temporary.codex\tmp\arg0directory, which Codex regenerates after restarting.Verification
After restarting Codex, check the generated wrapper:
The wrapper should reference the npm-installed
codex.exe, not the executable underC:\Program Files\WindowsApps.