5.3 apply_patch fails under sandboxed default permission on Windows
What version of the Codex App are you using (From “About Codex” dialog)?
0.108.0-alpha.8
What subscription do you have?
$200
What platform is your computer?
Microsoft Windows NT 10.0.26100.0 x64
What issue are you seeing?
This report was generated by 5.3-codex itself, and confirmed by me: It fails to apply any patches under the default permission mode, showing "Refused" on the UI. However, patches can be applied with highest permissions. Meanwhile, Codex on macOS can correctly apply patches with default permissions. Therefore, I suspect this is a bug. I conducted a test with 5.3-codex and got the following report:
Summary
When running in workspace-write (not read-only), built-in apply_patch fails for both Add File and Update File with:
- Exit code: 1
- Empty output
No permission/grant prompt is shown, and no actionable error message is returned.
Environment
- Workspace:
E:\c_misc\tmp\testspace - Mode shown:
workspace-write - Shell not used for repro (built-in tool only)
- Network restriction status is irrelevant for this repro
Reproduction Steps
- Try creating a file via
apply_patch:
Add File: ap_test_create.txt- content:
apply_patch create test
- Try updating an existing file via
apply_patch:
Update File: daipaibulaodi.ja.md- replace first line with another line
- (Control) Try deleting the not-created file:
Delete File: ap_test_create.txt
Expected Behavior
- In
workspace-write,Add FileandUpdate Fileshould succeed in workspace paths. - If blocked, the tool should return a clear permission/validation error.
Actual Behavior
Add File: Exit code 1, empty outputUpdate File: Exit code 1, empty outputDelete File: returns a normal verification error (file not found), indicating path checks still work
Raw Observations
- No escalation/permission prompt appeared for failed
Add/Update. - Failures are reproducible and opaque (no stderr/body), which makes diagnosis difficult.
Impact
- Prevents basic file creation/editing through built-in tool even in non-read-only mode.
- Blocks normal coding workflow and automated patching.
What steps can reproduce the bug?
- Create a new folder and add a file with a few lines of content
- Ask 5.3-codex to modify the file under the default permission mode
- Observe the "Refused" error on the UI
What is the expected behavior?
The file should be edited properly
Additional information
_No response_
39 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
the same
Mine's asking for permissons to do anything constantly, doesn't matter if I give it full access, default, etc. It's impossible to use! It also does not remember any "for this session" choice, and neither do sub agents. It's entirely unsuitable for work
Same issue. GPT-5.4 debugged itself and created bug report:
Version:
Issue:
apply_patchalways fails in Desktop withexit_code: 1and empty output. No file changes are made.Debugging results:
apply_patchcreate: failedapply_patchupdate on existing file: failedapply_patchsucceededConclusion:
This looks Desktop-specific, not a workspace permission issue, not general file I/O, and not a basic patch syntax problem.
I am facing this same issue too, switching to Full Access mode worked for me, though this is not desirable. When I try to submit feedback using /feedback it doesn't work and gives me an error saying feedback could not be submitted.
Using Codex windows app. GPT-5.4 with Full Access and Extra High Reasoning can't use the apply_patch tool and keeps saying it is failing with exit code 1. Here is the thread_id: 019cc04f-565c-7543-a0ff-9424111927d9
same issue. Codex told me to say this:
apply_patch works in native codex CLI on this machine, but fails in the Codex Windows app under sandboxed modes. Device context: Lenovo model 83F5, Windows 10.0.26200.0, CPU Intel(R) Core(TM) Ultra 9 275HX, RAM 33,752,997,888 bytes (~31.4 GB), native PowerShell environment, repo on local Windows filesystem. In the app, [features] apply_patch_freeform = true is enabled. Repro is a trivial patch such as:
* Begin Patch
* Add File: smoke.txt
+hello
*** End Patch
A trivial update to an existing file also fails. In the Codex Windows app, every apply_patch invocation fails immediately with exit code 1 and no diagnostic output. I confirmed this is not a patch-format or path issue: absolute path, relative path, Add File, and Update File variants all fail. It also fails in sandboxed configuration with: approval_policy = "never", sandbox_mode = "workspace-write", [sandbox_workspace_write] network_access = true, [windows] sandbox = "elevated", and features.unified_exec = true. It succeeds only in Full access / danger-full-access. Control case: native codex CLI using the same machine, same repo, and same config can apply patches successfully. That strongly suggests the issue is specific to the Codex Windows app’s sandboxed apply_patch path, likely in the native Windows workspace-write sandbox/integration rather than config, approvals, or patch content.`
Seems like a pretty massive bug that's impacting all windows app users? Not sure how OpenAI isn't on top of this by now.
We're looking into it. We're juggling a lot of issues today because of the Windows app launch yesterday and the gpt-5.4 launch today. Please bear with us, and thanks for your patience.
@yaboijbigs, you said that you're seeing this behavior even with "full access" mode? That seems to contradict what others on this thread are saying. Just trying to narrow down the problem.
Also, I wouldn't assume this is "impacting all Windows app users". I don't think we have evidence of that. We're still trying to understand the cause.
One thing that I noticed from the initial report: @EarzuChan, you mentioned that your workspace is on your
E:drive. I presume that's not your system drive. I wonder if that's a common thread here. Do the rest of you have your workspace/project stored on a non-system drive?@etraut-openai you're right and I apologize, I didn't take that into consideration.
I switched to full access mode in a new message/conversation and was able to get it to work!
Yep @etraut-openai Thanks for being so fast
Same issue here, apply_patch fails 100% of the time in Default Permissions, but works with Full Access mode. On the windows Codex app.
I am experiencing this issue and my project is stored in my OneDrive>Documents directory. I haven't tried starting a project outside of OneDrive and seeing if the issue persists. That could be related.
Thanks everyone for reporting this issue.
We think we understand the problem, and we're working on a fix.
My project is indeed on E: as well, which is not my system drive...
same problem
We've introduced a fix with this PR. It will be included in the next release. Thanks to everyone who reported the problem and provided details to help us track it down.
In addition to the apply_patch problem on Windows, I also noticed a process cleanup issue.
After closing the Codex desktop app, multiple Codex-related processes remain running (Codex, Windows PowerShell, and conhost).
Each new app launch adds more processes instead of reusing/cleaning up existing ones.
After several open/close cycles, I had around 70 processes left and total memory usage reached about 2 GB.
Expected behavior:
When the app is closed, all child/background processes started by Codex should be terminated.
Actual behavior:
Processes remain alive after close, and process count grows with each new launch.
Same issue. When is next release?
same issue
Still experiencing this exact issue after the latest codex update from microsoft store on Windows 11. I'm forced to run everything in Full access mode otherwise Codex is unable to apply patches correctly. They all get "rejected" in the sandbox.
@swebdevelopers I recommend you create a new issue about the processes not closing issue so it can get more attention.
When will the new version with the fix be released?
@ningjiaen123, we don't release on a fixed schedule, but we generally publish two or three releases each week. That means we should have a new release out in the next day or two.
IGNORE - diagnostic read attempt by assistant; please disregard.
<img width="970" height="701" alt="Image" src="https://github.com/user-attachments/assets/856e7c45-0810-464a-955e-f4bb282b681f" />
same problem
same problem
Same issue on the Windows Codex app.
<img width="1374" height="602" alt="Image" src="https://github.com/user-attachments/assets/d03ead8d-e90d-48e8-875f-a5c93cb5af12" />
I want to know why this happened and how to deal with this issue.
Same here, codex wrote the report:
Bug Report
apply_patchfails consistently on Windows Codex desktop, even for trivial add-file patches in a writable workspace.Environment
OpenAI.Codex_26.306.996.0_x64C:\Git\Gameworkspace-writeWhat I tested
apply_patchreturned exit code1Why this looks like a Codex bug
HEADand tracked filesSo patch content is valid, and filesystem permissions are not the issue.
Additional observations
apply_patchExpected
apply_patchshould create or modify files in the writable workspaceActual
apply_patchfails immediately with exit code1and no actionable error outputThanks for the bug report. This is a known issue. See #14196. We already have a fix in place, and a new version should be out shortly.
If anyone is too impatient to wait for a fix, a workaround for this would be to grant read access for your logged in user in ACL of folder
C:\Program Files\WindowsApps\OpenAI.Codex_xxxxx (xxxxx being the version number).
Both rg.exe and apply_patch started working after I did this.
I am suddenly seeing the same issue on codex 0.116. It started happening yesterday, out of nowhere, without me doing an update. I was surprised how the sandbox can suddenly misbehave.
Still no fixed, files with over 1k lines always get rejected!
This serious issue still persists in the latest version of Codex! I've lost all patience. Every time it fails, it clears my files! Then Codex starts to recover bit by bit. Isn't this a waste of my tokens?
Same issues on codex cli on linux.
The codex cli version is
0.117.0.<img width="354" height="123" alt="Image" src="https://github.com/user-attachments/assets/3f85f863-d0bb-4fa7-a3c5-11cef13f84b4" />
<img width="1205" height="140" alt="Image" src="https://github.com/user-attachments/assets/ad8e6e92-e6b9-45ef-97d7-6fecacda7210" />
@etraut-openai have you noticed that there is a regression? Even on a fresh and clean windows 11 install I frequently see "Failed to apply patch", only giving it Full Access helps. Other than that, most of the time it works around with powershell CLI tools to apply the changes but only after discovering that apply_patch failed; costs lots of tokens and time
@AmazingTurtle, this issue was fixed and closed a few weeks ago. If you're seeing a similar behavior or believe that there's a regression, please open a new bug report with details requested in the bug template.