apply_patch fails on Windows with multiple writable roots
What version of the Codex App are you using (From “About Codex” dialog)?
Version 26.715.72359
What subscription do you have?
Pro
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
On Windows, apply_patch fails before it opens any workspace file.
Error:
windows unelevated restricted-token sandbox cannot enforce split writable root sets directly; refusing to run unsandboxed
The task is launched with two writable roots:
I uninstalled the Visualize plugin and restarted both the laptop and Codex, but new Codex tasks still receive the visualization writable root. This prevents apply_patch from editing any file.
Expected: apply_patch should work in a normal local project task, or Codex should not attach the stale visualization root.
What steps can reproduce the bug?
- Open the Codex desktop app on Windows.
- Open a local project task in
- Ask Codex to make any small file edit using apply_patch.
- The task environment includes the project root plus a .codex\visualizations\...\ directory as writable roots.
- apply_patch fails before reading or modifying the target file.
I also uninstalled the Visualize plugin and restarted both Codex and Windows. New tasks still get the extra visualization writable root and reproduce the same failure.
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
I can reproduce a distinct elevated-sandbox variant of this bug on Windows Codex Desktop. The CLI installed alongside it reports
codex-cli 0.146.0.The effective permission graph includes:
C:\Users\<user>C:\Users\<user>\.codexC:\Users\<user>\.codex\visualizations\<date>\<thread>Every command spawn then fails before the command runs with:
A fresh CLI run constrained to the exact repository with
--sandbox workspace-write --cd <repo>succeeds. That indicates the repository ACLs are not the cause; Desktop is emitting an impossible writable-parent / protected-child / reopened-writable-descendant root graph.User impact
This has turned into an almost six-hour troubleshooting task. The complete task's cumulative local counters at audit time show:
I am not claiming that every one of those tokens is directly billable or solely attributable to this defect; cached and non-cached usage are accounted differently. The figures show the total scale of the troubleshooting task and its substantial credit/usage-limit impact.
Separately, three specifically measured exact-repository workaround runs consumed 81,276 additional tokens outside the actual benchmark, including a 26,315-token failed child and a 35,417-token successful child. The fallback reloads task context, so every failed Desktop spawn can cause significant duplicated work.
Please address both layers:
workspace-writechild and return its result to the original task.CODEX_HOME.The elevated backend's fail-closed behavior should remain intact; weakening the sandbox or using full access is not an acceptable fix.
This is related to #34970 because the same visualization root is injected, but it is not the same refusal path: #34970 reports the unelevated split-root check, while this report reaches the elevated reopened-descendant check.