Repository navigation
Description
Environment
OS: Windows 11 (10.0.26200), zh-CN
Codex desktop app: 26.908.70816
Codex CLI observed across: 0.154.0-alpha.6.2, 0.155.0-alpha.2.6, 0.155.0-alpha.9, 0.162.0-alpha.2
Runtime: %LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\3dd31cfff853001c
Model provider: custom (DeepSeek via the native Responses API) — unrelated to this bug, see note at the end
Symptom
Every local-process capability fails at initialization, before any command runs:
代码块
Failed to create unified exec process: helper_unknown_error: setup refresh had errors
windows sandbox failed: helper_unknown_error: setup refresh had errors
Affects all three paths: shell command execution, the Node runtime, and file writes. The app's own file/thread APIs still work, so the failure is isolated to the sandbox helper bring-up.
Persists across app restart and machine reboot.
Root cause
setup refresh must open files inside the runtime directory to apply ACLs. Those same files are held open by processes the app has already spawned from that directory, so the open fails:
代码块
[2026-10-09T12:13:48.074258+00:00] runtime read/execute validation failed:
validate runtime read/execute access on
C:\Users<user>\AppData\Local\OpenAI\Codex\runtimes\cua_node\3dd31cfff853001c\bin\node_repl.exe:
open ACL target for root-only update:
另一个程序正在使用此文件,进程无法访问。 (os error 32)
["another program is using this file, the process cannot access it"]
[2026-10-09T12:13:48.078] setup refresh: processed 4 write roots (read roots delegated);
errors=["runtime read/execute validation failed: ..."]
[2026-10-09T12:13:48.078] setup refresh completed with errors: [...]
[2026-10-09T12:13:48.078] setup error: setup refresh had errors
[2026-10-09 20:13:48.082 codex.exe] setup refresh: exited with status ExitStatus(ExitStatus(1))
os error 32 is ERROR_SHARING_VIOLATION — the file is open by another process with a share mode that forbids the write/open the ACL update needs.
The ordering is the bug
代码块
20:12:46 codex.exe (app) starts
20:13:21 node_repl.exe spawned from the runtime dir ← locks its own executable
20:13:48 setup refresh runs ← tries to ACL node_repl.exe → fails
Files observed as the failing target across runs (whichever is locked first):
...\bin\node_repl.exe
...\bin\node.exe
...\bin\node_modules@oai\sky\bin\windows\swift\x64\VCRUNTIME140_1.dll (loaded by codex-computer-use-swift.exe)
Experiments that isolate it
Clean window ⇒ setup succeeds. With the app and all runtime processes stopped, and the CodexSandboxService.OpenAI.Codex service stopped, the same command produces:
代码块
setup refresh: processed 0 write roots (read roots delegated); errors=[]
and the stale %USERPROFILE%.codex.sandbox\setup_error.json disappears. So the ACL logic itself is fine — this is purely a race.
Pre-granting the ACLs does not help. I applied a non-inherited ReadAndExecute, ReadAttributes, Synchronize ACE for CodexSandboxUsers to all 2365 files under the runtime directory. Validation still failed on the locked file. So validation genuinely needs to open the target; it does not skip already-correct targets.
The app process itself holds the handle. With zero node_repl.exe processes running, an exclusive-open test on node_repl.exe still failed; terminating codex.exe released it immediately.
Reboot does not help because the app re-spawns the lockers, and setup refresh runs again on subsequent sessions.
No user-config workaround exists. Removing [mcp_servers.node_repl], disabling the computer-use@openai-bundled / unified-computer-use@openai-bundled plugins, and disabling the notify hook did not stop node_repl.exe or codex-computer-use-swift.exe from being spawned by the desktop app. The spawn is internal to the app.
Impact
The Windows sandbox feature cannot initialize at all, so no session can execute any local command. The app is effectively unusable for any task involving a shell, the Node runtime, or file writes.
Workaround
Bypassing the Windows sandbox entirely avoids setup refresh, and everything works:
toml
~/.codex/config.toml
sandbox_mode = "danger-full-access"
or per-invocation:
代码块
codex exec --dangerously-bypass-approvals-and-sandbox "..."
Verified: sandbox: danger-full-access then the command executes normally.
This is a workaround, not a fix — it removes OS-level isolation for every command.
Suggested fix
Any of these would resolve it:
Run setup refresh before spawning anything from the runtime directory. The current order (spawn first, ACL second) makes the failure deterministic.
Treat a locked target as non-fatal. If the required ACE is already present, or the file is simply in use, log and continue instead of failing the whole refresh. Right now one ERROR_SHARING_VIOLATION on one file aborts the entire sandbox bring-up.
Stage the ACL work off the live tree. ACL a staged copy (or a temp junction) and swap it in, so ACL application never touches in-use binaries.
Retry with backoff and don't fail the session on a transient sharing violation.
Note on the provider
This reproduces with the stock sandbox path and is unrelated to any custom model provider: the failures are in codex-windows-sandbox-setup.exe / codex-command-runner bring-up, which never reaches the model. I mention it only so the report isn't mistaken for a provider-integration issue.
Diagnostic commands used
powershell
failing target + reason
Get-Content "$env:USERPROFILE.codex.sandbox\sandbox.$(Get-Date -Format yyyy-MM-dd).log" |
Select-String 'setup refresh|validation failed'
reproduce quickly (no model turn needed)
codex sandbox -- echo test
confirm an exclusive lock on the failing target
$f = "\bin\node_repl.exe"
try { $fs=[IO.File]::Open($f,'Open','ReadWrite','None'); $fs.Close(); 'unlocked' }
catch { 'LOCKED: ' + $_.Exception.Message }
Activity
github-actions commentedon Oct 9, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
huangprometheus-dotcom commentedon Oct 9, 2026
Environment
0.162.0-alpha.2[windows] sandbox = "unelevated"(see note on the elevated-mode blocker below)C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exesetup refresh/os error 32on thecua_noderuntime)Summary
After the
setup refreshissue in #52488 is worked around, sandboxed command execution works — but any Chromium-based browser launched inside the sandbox crashes immediately, so no HTML→PNG/PDF rendering and no browser automation is possible from a sandboxed command.This blocks an entire class of legitimate desktop work: generating slide/diagram assets, screenshotting local HTML, exporting PDFs, and any Playwright/Puppeteer-driven step.
Symptom
Launching Edge from a sandboxed command produces a Windows crash dialog:
0x80000003isSTATUS_BREAKPOINT. Codex's own commentary in-session reported:Root cause (from measured behavior)
Sandboxed commands run as a restricted account (
CodexSandboxOffline/CodexSandboxOnline). That identity has no write access to the real user's browser profile directory, and Chromium cannot initialize without it.Step 1 — default paths: profile/crashpad write denied
Step 2 —
--no-sandboxalone is not enoughChromium's own sandbox is disabled, but crashpad still targets
%LOCALAPPDATA%\Microsoft\Edge.Step 3 — redirecting profile/crash dirs into the workspace also denied
Flags used:
Result:
So even a path inside the workspace is not writable by the sandbox identity in this invocation.
Step 4 — granting the restricted account access is not possible for the user
Attempting to add a
ModifyACE forCodexSandboxOfflineon%LOCALAPPDATA%\Microsoft\Edgefails:i.e. it requires administrator rights. Users cannot self-serve this fix.
Step 5 — the same command outside the sandbox succeeds
The identical headless Edge invocation, run as the normal user (outside the Codex sandbox), renders correctly:
This isolates the failure to the sandbox execution context, not to Edge, the flags, or the HTML.
Reproduction
[windows] sandbox = "unelevated"sosetup refreshno longer fails (per Windows sandbox unusable: setup refresh fails with os error 32 (app-tools MCP holds the cua_node runtime exe) #52488).out.pngwritten.Actual:
msedge.execrash dialog,0x80000003; no output file.Impact
Workaround (working, but should not be necessary)
Run the browser outside the sandbox and pass content through the filesystem, so sandboxed commands never spawn a browser:
_render-inbox\*.html._render-outbox\<name>.png.No network, no privilege escalation, no browser process inside the sandbox. Verified working end to end.
(Relevant because it shows the capability gap can be closed by product design: if Codex shipped an out-of-sandbox render helper, users would not need to build one.)
Suggested fix
Any of these would resolve it:
0x80000003; a message such as "Chromium-based browsers cannot run inside the Windows sandbox; run this step outside the sandbox" would save users a long diagnosis.Playwright's spawn is blockednotice, so the behaviour is expected rather than looking like a regression.Notes
sandbox = "elevated"does not change it.--single-process/--disable-gpu-sandbox/--in-process-gpuwere not sufficient in testing; the failure is the restricted identity, not process topology alone.Diagnostic commands used
msggolden commentedon Oct 28, 2026
Additional user-confirmed observation for the Chromium launch failure described in the October 9 comment (not confirmation of the separate runtime setup/OS error 32 issue):
On a Windows machine running the Codex desktop app, Google Chrome launched by an agent shell command sometimes failed with a chrome.exe application-error dialog: unknown software exception 0x80000003. Launching Chrome manually from CMD worked. Restarting Windows and omitting the Chrome profile argument did not resolve the agent-initiated failure.
The workaround that has worked in subsequent runs was to execute only the Chrome launcher through Codex's approved out-of-sandbox exec_command path (sandbox_permissions="require_escalated"), as the normal signed-in Windows user. This was not a PowerShell RunAs/administrator launch. The launcher could retain its existing profile-directory and starting-URL arguments.
No browser --no-sandbox flag, profile reset, directory ACL changes, or global approval/sandbox bypass was needed. Once Chrome was launched this way, the official Chrome extension connection could read the task tab and the workflow completed. On October 28, the first scheduled connection attempt succeeded without restarting Codex.
This is one machine's observed workaround, not a universal fix or proof that every earlier extension/controller failure had the same cause. It may be useful to distinguish browser-launch context failures from actual extension-connection failures, and to document a supported, approval-gated browser-launch path. The proposed profile/Crashpad write-access explanation remains a hypothesis for this particular case. Summary prepared with Codex assistance, based on this user-authorized troubleshooting session. Workaround observed through October 28, 2026; the exact Codex app and Chrome versions were not recorded for the original failing comparison.