Windows sandbox 0.146.0: physical standalone package reaches SpawnChild but CreateProcessAsUserW fails with error 2
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- rust
- Domain
- cli, operating-systems
Research direction
Reproduce the failure with the provided PowerShell command and trace the Windows sandbox SpawnChild path around CreateProcessAsUserW. Use the absolute cmd.exe and PowerShell cases to isolate the launch failure; done means the harmless command prints CODEX_WINDOWS_SANDBOX_OK and exits with code 0.
Written by the indexing model from the issue text.
Description
Summary
On an official Windows standalone installation, the native sandbox cannot start even a harmless child process.
The PATH shim initially exhibits the helper-resolution problem already reported in #32655. However, unlike the reproductions in that issue, invoking the physical 0.146.0 release binary with its matching codex-resources directory available still fails later during SpawnChild:
CreateProcessAsUserW failed: 2
The setup helper, command-runner copy, and ACL setup all complete before the failure.
Environment
- Codex CLI:
0.146.0 - Installation: Windows standalone package
- Package architecture:
x86_64-pc-windows-msvc - Registry
ProductName:Windows 10 Pro DisplayVersion:25H2- OS build:
26200.8973 - Sandbox mode tested:
unelevated codex doctor: 17 checks OK, 0 failures
The failure occurs before model execution.
Minimal reproduction
Run from ordinary PowerShell:
$releaseRoot = Join-Path $env:USERPROFILE `
'.codex\packages\standalone\releases\0.146.0-x86_64-pc-windows-msvc'
$codex = Join-Path $releaseRoot 'bin\codex.exe'
$resources = Join-Path $releaseRoot 'codex-resources'
$cmd = Join-Path $env:SystemRoot 'System32\cmd.exe'
$originalPath = $env:Path
try {
$env:Path = "$resources;$originalPath"
& $codex sandbox windows `
-c 'windows.sandbox="unelevated"' `
-- $cmd /d /c `
'echo CODEX_WINDOWS_SANDBOX_OK'
Write-Host "SANDBOX_EXIT_CODE=$LASTEXITCODE"
}
finally {
$env:Path = $originalPath
}
Expected behavior
The sandbox should execute the harmless command and return:
CODEX_WINDOWS_SANDBOX_OK
SANDBOX_EXIT_CODE=0
Actual behavior
The setup stage succeeds, including locating/copying the command runner and completing the ACL work. The requested child process never starts:
windows sandbox: runner failed during SpawnChild:
CreateProcessAsUserW failed: 2
The sandbox command exits with code 1.
Additional tests
The same failure occurs when:
cmd.exeis supplied through its absoluteSystem32path.- Windows PowerShell 5.1 is supplied through its absolute path.
windows.sandbox_private_desktop=falseis set.- The physical release binary is used instead of the PATH shim.
- The matching release
codex-resourcesdirectory is prepended toPATH.
Confirmed:
codex-windows-sandbox-setup.exeexists and executes.codex-command-runner.exeexists, is found, and is copied.- The command targets exist and run outside the sandbox.
- The standalone and AppX resource copies inspected were identical.
codex doctorreports a healthy installation but does not detect this child-process launch failure.
The sandbox log also contains an Access denied warning involving C:\Users\Default, but I cannot establish whether that warning causes the CreateProcessAsUserW failure.
Relationship to #32655
Issue #32655 covers helper discovery through the Windows PATH shim. Its reported workaround or use of the physical package binary allows sandbox execution to succeed.
In this environment, correcting helper discovery allows setup to progress, but the physical package still fails during SpawnChild. This therefore appears to be an additional failure after the #32655 helper-resolution stage.
A sanitized sandbox.<date>.log can be supplied if needed. No files from .sandbox-secrets will be shared.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- Avg merge
- 1m
- Merged PRs (30d)
- 1k
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openai/codex
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug CLI windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
macOS sandbox blocks hw.optional.arm64 sysctl, causing Flutter to misdetect Apple Silicon as x64 Openbug CLI sandbox
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug CLI TUI
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
CLI config enhancement skills
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
A-linter
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oxc-project/oxc#26863 ·