Repository navigation
Windows workspace-write sandbox can change project ownership to CodexSandboxOffline and cause persistent write failures #17179
Description
What version of the IDE extension are you using?
VS Code extension version: 26.318.11754
What subscription do you have?
ChatGPT Plus
Which IDE are you using?
Antigravity, VS Code
What platform is your computer?
Windows
What issue are you seeing?
Title
Windows sandbox workspace-write can corrupt directory ownership to CodexSandboxOffline, causing persistent write failures until manual admin ACL repair
Summary
I hit a Windows-specific issue where Codex could write successfully in full access mode, but failed in workspace-write / custom sandbox mode for files inside my project.
The failure persisted across:
- waiting and retrying later
- restarting the computer
- switching IDEs from Antigravity to VS Code
The problem was eventually traced to directory ownership / ACL corruption inside the project. Some directories and files had their owner changed to CodexSandboxOffline instead of the normal Windows user account. While that state remained, sandbox setup failed and Codex could not edit files in those locations.
Manual repair from an Administrator PowerShell session restored normal behavior.
Environment
- OS: Windows
- Codex sandbox mode:
workspace-write - Approval policy:
never - Windows sandbox setting:
elevated - IDEs tested:
- Antigravity
- Visual Studio Code
Config
This is the relevant Codex config shape:
model = "gpt-5.4"
model_reasoning_effort = "low"
approval_policy = "never"
sandbox_mode = "workspace-write"
writable_roots = [
'<PROJECT_ROOT>',
'<ANOTHER_WORKSPACE_ROOT>'
]
[features]
multi_agent = true
[windows]
sandbox = "elevated"What happened
I was working normally, and file edits had worked previously.
At some point:
- the internet connection dropped
- an IDE update had happened a few hours earlier
- later, Codex started failing to edit a file inside the project in custom /
workspace-writesandbox mode
I do not know whether the network interruption was causal, but the timeline suggests that sandbox state may have been left half-updated or recovered incorrectly after an interruption.
Initial symptoms
When Codex tried to edit a file with apply_patch, it failed with:
windows sandbox: setup refresh failed with status exit code: 1
When Codex tried a direct PowerShell rewrite of the same file, it failed with:
Access to the path '...AppConfig.ahk' is denied.
In full access mode, the same edit succeeded immediately.
Important behavior difference
full access: file edits succeededworkspace-write/ custom sandbox: file edits failed
This strongly suggested a sandbox setup / ACL issue rather than a file-content issue.
IDE switching did not fix it
I changed from Antigravity to Visual Studio Code and reopened the same chat/session context.
The failure reproduced in VS Code as well:
apply_patchstill failed with sandbox setup refresh errors- direct file writes still failed with
Access denied
This suggests the issue is not specific to one IDE frontend.
Restarting did not fix it
After a full machine reboot, the same write failure still happened in sandboxed mode.
In one attempt, a related launcher failure also appeared:
CreateProcessWithLogonW failed: 1056
Even after that, the underlying issue remained: sandboxed writes to the affected project path were broken.
Sandbox log evidence
The most important evidence came from the sandbox log. It showed that sandbox setup was trying to grant a write ACE to a project subdirectory and failing with Windows error 5 (Access is denied):
granting write ACE to <PROJECT_ROOT>\src\Core for sandbox group and capability SID
write ACE grant failed on <PROJECT_ROOT>\src\Core: SetNamedSecurityInfoW failed: 5
setup refresh completed with errors
setup error: setup refresh had errors
This lines up exactly with the user-visible apply_patch failure.
ACL / ownership inspection
Inspecting the project showed that:
- the project root owner was the normal user account
- some subdirectories were owned by
CodexSandboxOffline - affected files under those directories were also owned by
CodexSandboxOffline
Example pattern:
<PROJECT_ROOT>owner: normal user account<PROJECT_ROOT>\srcowner:CodexSandboxOffline<PROJECT_ROOT>\src\Coreowner:CodexSandboxOffline
This seems wrong and likely explains why sandbox ACL refresh could not proceed.
Scope of corruption
After scanning the whole project, many items had the wrong owner. In my case the scan found hundreds of mismatches, concentrated in directories like:
temptestsruntimematerials- some tracked files in project root and
docs
The wrong owner observed was consistently:
CodexSandboxOffline
Repair attempt
Normal non-admin repair attempts failed:
icacls /setowner ...returnedAccess is deniedtakeownreported that the current user did not have administrative privileges
Repair only worked from an Administrator PowerShell session.
These commands were used successfully:
takeown /F "<PROJECT_ROOT>" /R /D Y
icacls "<PROJECT_ROOT>" /setowner "<MACHINE>\<USER>" /T /C
icacls "<PROJECT_ROOT>" /inheritance:e /T /CAfter that:
- affected directories were owned by the normal user again
- sandboxed
apply_patchstarted working again - sandboxed writes to the previously failing file succeeded
Strong suspicion
My current suspicion is:
- Codex sandbox touched project ACLs / ownership during a degraded or interrupted state
- ownership on some paths was left as
CodexSandboxOffline - later sandbox setup attempts could no longer repair those paths
full accessworked because it bypassed the failing sandbox ACL setup path
I cannot prove that the network drop caused it, but the timing is suspicious. The IDE update may also have changed sandbox behavior or made a previously latent ACL problem visible.
Expected behavior
workspace-writeshould never leave project files or directories owned by a transient sandbox identity likeCodexSandboxOffline- sandbox setup failure should not permanently poison a workspace until manual admin ACL repair is performed
- if ACL modification fails, Codex should provide a more explicit diagnosis
Actual behavior
- ownership of project files/directories changed to
CodexSandboxOffline - sandbox setup started failing with
SetNamedSecurityInfoW failed: 5 apply_patchfailed withsetup refresh failed- file writes in sandboxed mode became impossible until manual admin repair
Suggested areas to investigate
- sandbox ownership / ACL mutation on Windows
- recovery behavior after interrupted sandbox setup
- behavior differences between normal online state and any offline / degraded fallback identity
- why
CodexSandboxOfflinecan become the owner of user project paths - whether IDE update + sandbox helper version change can expose or create this state
Minimal repro shape
I do not yet have a fully deterministic repro from scratch, but this was the observed sequence:
- Use Codex on Windows with
workspace-write - Successfully edit files in a project for a while
- Experience an interruption such as network drop and/or IDE update / restart during the same general period
- Later attempt an edit in the same project
- Observe sandbox refresh failure and
Access denied - Inspect owners on subdirectories and find
CodexSandboxOffline
End result
The issue was only resolved after manual Administrator-level ownership repair of the project tree.
What steps can reproduce the bug?
I was using Codex on Windows with sandbox_mode = "workspace-write" and approval_policy = "never".
At first, file editing worked normally.
Later, after a period that included a network interruption and an IDE update, Codex stopped being able to edit files in the project when running in sandboxed mode.
Symptoms:
apply_patchfailed with:
windows sandbox: setup refresh failed with status exit code: 1- direct file rewrite attempts failed with:
Access to the path '...AppConfig.ahk' is denied.
I confirmed that the same edit succeeded immediately in full access mode.
I also reproduced the same sandboxed write failure after:
- waiting and retrying later
- rebooting the computer
- switching IDEs from Antigravity to VS Code
I inspected the sandbox log and found:
granting write ACE to <PROJECT_ROOT>\src\Core for sandbox group and capability SIDwrite ACE grant failed on <PROJECT_ROOT>\src\Core: SetNamedSecurityInfoW failed: 5
I then inspected file ownership and found that some project paths were owned by CodexSandboxOffline instead of my normal Windows user account.
Example:
<PROJECT_ROOT>owner: normal user<PROJECT_ROOT>\srcowner:CodexSandboxOffline<PROJECT_ROOT>\src\Coreowner:CodexSandboxOffline
After manually repairing ownership and ACLs from an Administrator PowerShell session, sandboxed writes started working again.
Uploaded thread: 019d6ccf-f4c0-72c2-9943-26f7321c67ad
What is the expected behavior?
workspace-write mode should not change project files or directories to be owned by a transient sandbox identity such as CodexSandboxOffline.
If sandbox ACL setup fails, it should not leave the workspace in a permanently broken state where Codex can no longer edit files until manual Administrator-level repair is performed.
Codex should either:
- preserve the original ownership correctly, or
- fail safely without corrupting ownership / ACL state, and
- report a clearer diagnostic if Windows ACL mutation fails.
Additional information
The issue appeared to be environment-independent at the IDE layer:
- it happened in Antigravity
- it also happened in VS Code
Rebooting did not fix it.
The issue was only resolved after running Administrator-level repair commands on the project tree, for example:
takeown /F "<PROJECT_ROOT>" /R /D Y
icacls "<PROJECT_ROOT>" /setowner "<MACHINE>\<USER>" /T /C
icacls "<PROJECT_ROOT>" /inheritance:e /T /C
Activity
github-actions commentedon Apr 9, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
mickitty0511 commentedon Apr 22, 2026
For windows users, worktrees development are not functioning. this issue is applied to me currently since the first launch of codex. This situation getting us worse in productivity and ci/cd. Those who see this issue and are on the same situation, give thumbs up to the issue; otherwise we won't get a full functionality with codex.
floxrot commentedon Aug 24, 2026
I can provide a deterministic reproduction for this issue.
Environment:
26.818.8289.00.149.0-alpha.4.3workspace-writeReproduction:
Start with an existing empty directory owned by the normal Windows user:
Add it as an additional writable workspace root to an existing Codex task.
Let Codex execute the following through a normal sandboxed command:
The command initially succeeds.
Inspect ownership afterwards:
.gittree:CodexSandboxOfflineREADME.md:CodexSandboxOfflineExecute any subsequent sandboxed command.
The next sandbox refresh fails before the requested command starts:
A single affected additional write root then prevents commands from starting even when the current working directory is a different, healthy repository.
In this reproduction, multiple objects were owned by
CodexSandboxOffline, including.git, its contents, and the copied README. The pre-existing workspace root remained owned by the normal user.Recovery was possible only after fully closing Codex and running an owner-only repair from a separate elevated PowerShell:
No ACL reset, inheritance change, or DACL modification was required. After restarting Codex, the sandbox smoke tests succeeded again.
This was not caused by a Git or commit skill. The repository was initialized directly by a sandboxed
git initcommand. The critical transition is creating a new repository or file inside an added write root under the sandbox identity.Expected behavior:
.gitcreated throughworkspace-writeshould not be left owned byCodexSandboxOffline.helper_unknown_error.alexanderfedyunin-bit commentedon Aug 25, 2026
Confirmed again on Codex Desktop for Windows, app package version
26.818.8289.0(bundled command runner0.149.0-alpha.4.3).The local executor fails before creating even a read-only process:
The underlying sandbox log is explicit (workspace path redacted):
Filesystem inspection of the failing directory:
CodexSandboxOfflineThe failure repeats on every sandbox setup refresh. Running the same read-only command outside the broken sandbox succeeds, confirming that the command and workspace are otherwise accessible.
The user reports that this is not limited to the current release: the same class of failure has recurred across multiple Codex updates, and updating has not repaired the poisoned ownership state.
Manual Administrator-level
takeown/icaclsrepair is not an acceptable product remediation. Codex created or retained theCodexSandboxOfflineownership state, so the sandbox setup must detect and recover from it itself. At minimum, setup should:CodexSandboxOfflineownership safely during refresh;helper_unknown_error;This currently makes Codex Desktop unable to run any local command in the affected workspace.
D1sconnected commentedon Aug 27, 2026
This bug is so annoying, and it has started happening all the time with 5.6 Luna. Please prioritize fixing it, because it's getting really difficult to work with 🙏
alexanderfedyunin-bit commentedon Aug 27, 2026
So, I canceled my Pro subscription to Codex today, no more ideas to accept such kind of quality in Win11, welcome back Claude :)
qubiq1337 commentedon Aug 27, 2026
This issue is the only thing keeping me from subscribing to Codex.
xbzhang1994 commentedon Aug 28, 2026
Confirming on
codex-cli 0.150.1(Windows 1110.0.26200), same class asthe Aug 25
.codexcomment and the Aug 24git initrepro.Deterministic trigger here:
Repo lives under a drive-root folder (
C:\projects\<repo>), so it inheritsthe default
C:\ACL (Authenticated Users:(M), noWRITE_DAC).A sandboxed command creates
.codex(New-Item .codex\tasks).Owner becomes
CodexSandboxOnline.Every later refresh fails:
deny ACE failed on C:\projects<repo>.codex: SetNamedSecurityInfoW ... : 5
helper_unknown_error: setup refresh had errors
Control: scanned 44 repos under
C:\projects. The only repo that never failedalready had an explicit
<user>:(OI)(CI)(F)ACE on the project root, so.codexinherited
WRITE_DACeven when created by the sandbox account.Workaround:
icacls C:\projects /grant "*<SID>:(OI)(CI)(F)"plus recreate anyalready-poisoned
.codexas the host user. This should not be required of users.lucaschang2021 commentedon Aug 29, 2026
I can reproduce a closely related failure on Windows and have a fairly clean elevated/unelevated A/B result.
Environment
10.0.26200.9168(x64)2.55.0.windows.32.7.12.0codex-cli 0.149.0codex-command-runner-0.150.0-alpha.12.2D:\FlowTracerGit/WSL/Docker and the repository itself all work normally outside Codex.
Symptom
With:
Codex became unable to create any local process, including read-only commands such as
git status.The surfaced error was:
Remote GitHub access still worked.
Underlying sandbox error
The current sandbox log under
%USERPROFILE%\.codex\.sandboxshowed the actual failure while refreshing ACLs for the repository:Windows error 5 is
ERROR_ACCESS_DENIED.ACL inspection then showed an unexpected ownership difference:
The user did not intentionally change the ownership of
.git.A/B test
I changed only:
to:
and restarted Codex Desktop.
The same workspace immediately recovered:
git status— PASSgit branch --show-current— PASSgit log— PASSREADME.mdread — PASSNo repository repair, ACL rewrite,
takeown, Git reinstall, WSL reinstall, or Docker reinstall was performed between the failing and successful tests.So on this machine the behavior is consistently:
This makes me suspect that the elevated Windows sandbox can leave or encounter a stale ownership/ACL state involving
CodexSandboxOffline, then fail a later ACL refresh when applying the deny ACE to.git.One additional observation: earlier sandbox setup refreshes on the same machine had succeeded; the failure appeared later during normal Codex use. I have not yet identified the exact operation that first changed the
.gitowner, so that part remains a hypothesis rather than a confirmed reproduction-from-clean-state.The unelevated sandbox is currently an effective workaround.
lucaschang2021 commentedon Aug 29, 2026
Confirmed workaround: switch Windows sandbox from
elevatedtounelevatedAdding the actual recovery procedure prominently in case it helps other Windows users hitting:
In my case the repository itself was healthy and Git worked normally from external PowerShell. The Codex sandbox log showed:
and
.gitwas unexpectedly owned byCodexSandboxOffline.Workaround that restored Codex immediately:
to:
On the same machine/repository, before the change local process creation,
git status, and local file reads all failed. After switching tounelevated,git status,git branch,git log, and local project file reads all passed immediately.No Git/WSL/Docker reinstall, repository recreation,
takeown, or recursive ACL reset was required.For diagnostics before changing ACLs:
I would recommend trying the
unelevatedworkaround before doing a recursive ownership/ACL rewrite, and preserving the logs/ACL state for diagnosis.This is a workaround rather than a confirmed upstream fix: ideally the elevated Windows sandbox should recover from stale ACL/ownership state without preventing all local process creation.
jdr377 commentedon Aug 31, 2026
I've had to integrate an intermittent check on file ownership to detect changes early because of this issue
deretame commentedon Sep 6, 2026
Additional reproduction variant: stale owner SID after Windows reinstall
I can reproduce the same failure when a data/workspace drive is retained across a Windows reinstall.
Environment/details:
elevated<WORKSPACE_ROOT>The current sandbox log reported:
After this, even a trivial sandboxed command such as
Get-Locationfailed before the target process started. The same directory was accessible from an elevated external PowerShell.The owner-only repair was sufficient; no ACL reset or repository recreation was needed:
After restarting Codex, the sandbox worked again.
This suggests a second recovery path for the same class of bug: a stale owner SID left by a Windows reinstall can prevent the elevated sandbox setup helper from writing the required ACE, while the UI only reports the opaque
helper_unknown_error: setup refresh had errors.The product should detect this condition and report the exact path and ownership/ACL failure, or provide a safe repair flow. A recursive ACL reset across an entire drive should not be required.
No personal account names, machine names, full SIDs, repository contents, or private log files are included here.
lurenjia2003lrj commentedon Sep 16, 2026
Ownership of a large part of the workspace was transferred to
CodexSandboxOffline, and 65 directories were additionally left inaccessible to the interactive userSame class as #17179, but the footprint is much larger and there are two distinct end states, only one of which is user-visible. The second state breaks tooling that has nothing to do with Codex, and cannot be detected from inside Codex.
Environment
10.0.26200, build26200, x64sandbox_mode = "workspace-write",[windows] sandbox = "elevated"C:\Dev\Project\Python\cup_det, a normal directory created by the interactive user2026-09-06→codex-command-runner-0.153.4.exe, app bin dir%LOCALAPPDATA%\OpenAI\Codex\bin\8e5b6932251c2c1c2026-09-15→codex-command-runner-0.154.0-alpha.6.2.exe, app bin dir%LOCALAPPDATA%\OpenAI\Codex\bin\bffc5354119c8421bindirectory was written again on2026-09-16, so the runtime may have moved on again after this excerptcodex-cli 0.147.0is also onPATH; that is a separate install, presumably unrelatedsetup_marker.json:version 5,offline_username: CodexSandboxOffline,online_username: CodexSandboxOnline,created_at: 2026-07-16T05:58:12Z,read_roots: [],write_roots: [],allow_local_binding: falsedeny_read_acl_state.json:{"principals": {}}Note: the log directory contains one file per day (
sandbox.YYYY-MM-DD.log), not a singlesandbox.log.Summary
After using Codex against this project, 4,885 directories are owned by
CodexSandboxOffline, and 65 of them additionally carry a DACL with no entry for the interactive user, so non-elevated access is denied.State 2 is what surfaced the problem: a third-party Python tool doing a normal recursive walk over the project aborts with
Access is denied. (os error 5).The workspace root and
.gitare NOT affectedSo this is not the "workspace root / parent taken over" pattern from #29867. Git's dubious-ownership check passes and Git works fine. The mutation is entirely in subdirectories.
State 1: 4,885 directories owned by the sandbox account
Ownership scan (run elevated, so that directories that deny the user can also be inspected):
Result:
count: 4885Concentrations:
A workspace-wide recursive pass is a much better fit for this scale than "a few directories got hit" (#29063).
State 2: 65 of them deny non-elevated access
All 65 sit under exactly three subtrees, and their names are a Python package set —
torch,numpy,cv2,scipy,sympy,fontTools,matplotlib,contourpy, plus the matching*.dist-infodirectories:Access scan — must be run from a non-elevated shell, because elevation masks the failure (
BUILTIN\Administratorshas Full Control):Result:
count: 65— reproduced from a confirmed non-elevated shell (IsInRole(Administrator)=False).The DACL on the access-denied directories
Example path
output\tool_dependencies\yaml, owner<MACHINE>\CodexSandboxOffline, CreationTime2026-09-06 22:17:23.Every ACE is explicit (
IsInherited = False), consistent with a protected DACL that no longer receives entries from its parent. There is no ACE for the interactive user, and the interactive user is not the owner — so the only way in is elevation, viaBUILTIN\Administrators.The
OWNER RIGHTS(S-1-3-4) entry is unusual to see persisted in a filesystem DACL and looks like a deliberately constructed security descriptor rather than an incidental side effect. Note that with the owner set to the sandbox account, anOWNER RIGHTSACE grants full control to the sandbox account, not to the user.Timeline: the directories were created in the same second as a sandboxed command
CodexSandboxOfflinereport CreationTime2026-09-06 22:17:23(sample:output\tool_dependencies\yaml)sandbox.2026-09-06.log, sandboxed commands start every ~12 s in that window; two of them start at22:17:21.288and22:17:23.639:22:16:43.007, and the next one at22:17:38.073:Combined with the fact that all 65 inaccessible directories are pip-style package directories (
<pkg>\plus<pkg>-<version>.dist-info\), the shape of it is: a sandboxed command invoked fromC:/...(see theSTARTlines), installing or unpacking a Python environment underoutput\, and the directories it created came out owned by the sandbox account — 65 of them with a DACL that excludes the interactive user.The full command lines follow the
STARTlines in the log; I can attachsandbox.2026-09-06.logif that helps.Additional observation (may deserve its own issue): persistent
read ACL run had errorssetup_error.jsonhas readread ACL run had errorscontinuously (last written2026-09-15 15:25:48). The failing operation is not on the workspace:Byte-identical lines appear nine days later on
2026-09-15, on every setup refresh. In the same refresh, the write-root work succeeds:C:\Users\<USER>\PCMangeris where the helper cannot set a security descriptor:There is no ACE for the interactive user, and the user is not the owner, so a non-elevated process has read-only access and no
WRITE_DAC. This is the mechanism described in #31620. It appears to be a separate problem from the ownership mutation above — I am including it only because it is reproducible on this machine and it shows the setup helper running with the user's filtered (non-elevated) token for this pass.On
0.154.0-alpha.6.2this read-ACL failure appears to be non-fatal — 0.3 s later the log shows the shell starting anyway (START: ...\pwsh.exe), and the harness stays usable. Reporting it as persistent degraded state, not a hard failure.Also logged on every refresh (possibly #35737, mentioned only for completeness):
Minor, separate: log lines embed the localized OS message, and on this Chinese-locale system it is written as mojibake (
鎷掔粷璁块棶銆?for拒绝访问。), i.e. GBK bytes decoded as UTF-8.Impact outside Codex
A third-party Python-based export/migration tool performs a normal recursive walk over the project and aborts with:
A user has essentially no chance of connecting this to Codex:
.gitlook completely normal (owner is the user, Git works),The user-visible symptom is "an unrelated tool fails on my project", not "Codex broke something".
Repair
Minimal repair, from an elevated shell, with Codex and any host IDE fully closed:
The broader workaround from #17179 (reset ownership, then re-enable inheritance across the tree) also works but is more invasive.
What I could not determine
data\...\tracking\*subtrees were populated from a Linux server via an IDE sync, which would normally write them as the interactive user.-Directoryonly. The file-level footprint is unknown and may be larger.sandbox.2026-09-06.log/sandbox.2026-09-15.logon request.Question for maintainers
OWNER RIGHTS + NT AUTHORITY\SYSTEM + BUILTIN\Administrators, all-explicit, somethingcodex-windows-sandbox-setup.exewrites deliberately? And does the setup path intend to change ownership at all, or only to add ACEs?WRITE_DACon paths the user does not own (thePCMangercase), which suggests it runs with the user's filtered token. How does the same component end up setting the owner toCodexSandboxOffline? The ownership change is what makes this unrecoverable without an elevated repair, since the user stops being the owner andicaclsfrom a normal shell returnsAccess is denied.Related
CodexSandboxOffline)SetNamedSecurityInfoW failed: 5on paths owned byBUILTIN\Administrators).gitvariant, breaks Git)read ACL run had errors)02-timestamps.csv
03-access-denied-dirs.txt
04-acls-of-denied.txt
01-owners-CodexSandbox.txt
lurenjia2003lrj commentedon Sep 16, 2026
Follow-up: when the sandbox-owned directories were created
CreationTime distribution across all 4,885 sandbox-owned directories, top 20 minutes:
Earliest: 2021/9/22 0:30:52
Latest: 2026/9/15 14:58:00
On 2026-09-06, grouped by second:
The sandboxed commands running in that window. The START line is wrapped in the log, so the following lines are the rest of the command line:
dariokraljevic-design commentedon Oct 1, 2026
Additional reproduction + a narrower recovery method that did not require recursively taking ownership of the whole repository.
Environment
codex-cli 0.159.2Symptom
Built-in
apply_patchworked on a file in the repository root, but failed on an ordinary file under an existingtests\directory:Windows reported that neither the directory nor the file was a reparse point:
The exact same file was readable and writable from Codex's sandbox shell:
So the failure was specific to the built-in patch/fs-helper path, not a general inability of the sandbox to read/write the file.
Filesystem difference found
The old physical
tests\directory was owned by:A freshly-created sibling directory was owned by the normal interactive user and inherited the current Codex capability ACL entries from the repository root.
Fresh nested directory test:
codex-clean-probe\probe.txtapply_patch-> PASSOld
tests\:apply_patch-> FAIL with false reparse-point errorNon-destructive recovery that worked
I created a fresh sibling directory and copied only file data/attributes/timestamps, deliberately excluding Windows security metadata:
Before swapping directories I compared every file by:
Result: all files were identical.
Then:
apply_patchworks insidetests2\.tests\outside the repository as a rollback backup.tests2\->tests\.git statusshowed no tracked-content changes.apply_patchunder the newtests\: PASS.The new
tests\owner is the normal user, and it has the current inherited Codex capability ACL entries.Conclusion / limitation
This strongly suggests that persistent historical Windows sandbox security state on the physical directory object can poison
apply_patch, and recreating that directory without copying its security descriptor can recover it.This test does not isolate which individual element was decisive: the
CodexSandboxOfflineowner, stale/missing capability ACEs, or their combination. Recreating the directory changed those together.The reported
path contains a reparse pointdiagnostic was definitely false in this reproduction.Related: #46213 and #46290.