Windows sandbox setup refresh fails for workspace on \\wsl.localhost UNC path
Summary
The Codex desktop app cannot start any sandboxed shell command when the saved workspace root is a WSL2 UNC path such as \\wsl.localhost\Debian\home\<user>\<repo>.
The failure happens during sandbox preparation, before the requested command starts:
windows sandbox: helper_unknown_error: setup refresh had errors
Environment
- Codex desktop app:
OpenAI.Codex 26.721.4979.0(Microsoft Store package) - Windows build:
26200 - WSL:
2.9.3.0 - WSL kernel:
6.18.35.2-1 - Distribution: Debian, WSL2
bubblewrap:0.11.0- Sandbox mode:
workspace-write - Shell host for the affected thread: PowerShell / Windows-native agent
Steps to reproduce
- Add/open a Git repository located under
\\wsl.localhost\Debian\home\<user>\<repo>in the Windows desktop app. - Start a task using the normal
workspace-writesandbox. - Run a read-only command such as
git status --shortwith that UNC path as the working directory. - The sandbox fails during
setup refreshbefore Git runs. - Retry from
C:\Windowswhile invokingwsl.exe -d Debian --cd /home/<user>/<repo> git status --shortinside the normal sandbox. The same setup-refresh error occurs, apparently because the thread still has the UNC workspace root registered.
Expected behavior
The Windows sandbox should either support the registered WSL UNC workspace root, route the operation through WSL, or provide a specific actionable error directing the user to switch the agent runtime to WSL.
Actual behavior
Every normal sandboxed shell invocation fails with helper_unknown_error: setup refresh had errors, including commands whose explicit working directory is on C:\.
Isolation / workaround
- Restarting both WSL (
wsl --shutdown) and the Codex app does not resolve the issue. wsl --updatereports that the latest WSL version is installed.- The same Git command succeeds with exit code 0 when
wsl.exeis executed outside the Windows sandbox. - The documented workaround is to switch Settings → agent → WSL and restart the app, or keep using explicit approved execution outside the Windows sandbox.
A separate line is sometimes printed after successful out-of-sandbox wsl.exe calls:
[0x...] ANOMALY: meaningless REX prefix used
It does not change the successful exit code and may be unrelated.
4 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I reproduced this issue and can add a few details about scope and recovery.
Environment:
10.0.26200.8894C:\...\<repo>directory\\wsl.localhost\Ubuntu-24.04\home\<user>\<repo>Before adding the WSL UNC folder, I ran the following five independent
shell_commandcalls, each explicitly usingsandbox_permissions: "use_default":Get-Date -Format oGet-LocationGet-Content -LiteralPath '.\AGENTS.md' -TotalCount 1git --versioncmd.exe /c verAll five commands completed without escalation and with exit code 0. The Windows sandbox worked normally, and Computer Use could inspect IntelliJ IDEA successfully.
After adding the WSL UNC folder, I repeated the same five commands with the same sandbox settings. All five failed before the requested command started with:
None of these commands accessed the UNC path. Merely registering it as an additional workspace root was sufficient to break the global sandbox refresh. Node REPL and Computer Use then also failed during sandbox startup with the same error.
Recovery behavior:
This directly corroborates the reported WSL UNC trigger and additionally indicates that the failing root configuration or derived sandbox state remains persisted for the existing project/task after the UNC root is removed. A newly created local-only project does not inherit the failure.
Follow-up with direct Win32 API evidence and a current-source check.
I called
GetNamedSecurityInfoWdirectly through a read-only P/Invoke probe usingSE_FILE_OBJECTandDACL_SECURITY_INFORMATION. This bypasses PowerShellGet-Acland does not modify any ACL.Results on one Windows host:
| Path class | Result |
|---|---:|
| Native local NTFS path (
C:\<local-workspace>) |0— success ||
\\wsl.localhost\Ubuntu-24.04\home|1—ERROR_INVALID_FUNCTION||
\\wsl.localhost\Debian\home|1—ERROR_INVALID_FUNCTION||
\\wsl.localhost\docker-desktop\tmp|1—ERROR_INVALID_FUNCTION||
\\wsl$\Ubuntu-24.04\home|1—ERROR_INVALID_FUNCTION|| Same local NTFS workspace reached through
\\wsl.localhost\Ubuntu-24.04\mnt\c\<local-workspace>|5—ERROR_ACCESS_DENIED|Environment: Windows
10.0.26200.8973, WSL2.3.26.0, kernel5.15.167.4-1; Ubuntu 24.04.4 LTS and Debian 13 run as WSL2 distributions.This narrows the failure to the Windows ACL operation across the WSL UNC provider. It is not introduced by
Get-Acl, not specific to Ubuntu versus Debian, and not specific to the\\wsl.localhostalias. Native Linux paths exposed by the provider reject the DACL query with code 1; even an underlying NTFS path that succeeds throughC:\fails when addressed through the WSL UNC/DrvFs route.The current public source still appears to apply
ensure_allow_write_acesto configured write roots, aggregate any failure intorefresh_errors, hard-fail refresh withsetup refresh had errors, and map that untyped failure toHelperUnknownError:Repository search at that revision found no WSL-UNC, remote-drive, or
FILE_PERSISTENT_ACLSpreflight in this path. A safe fix likely needs either WSL-aware routing or an explicit unsupported-root classification before Windows DACL mutation; one incompatible root should also not poison unrelated local commands.Reproduced on a current Windows desktop build with the same WSL UNC trigger and broader impact across all local execution surfaces.
Environment:
Observed:
Impact:
The issue body mentions switching Settings > agent > WSL as a workaround. In app 26.825.3734.0 the current Settings navigation shows Configuration, Environments, Worktrees, Browser, and Computer use, but no Agent entry or discoverable Windows-to-WSL runtime selector. Please either expose/document the current location of this switch or make WSL UNC roots route through a WSL-native sandbox automatically.
This also reproduces the Browser/Chrome symptom tracked in #24101.