Retest of issue 24871 still fails just differently

Open 💬 3 comments Opened Jun 13, 2026 by advgiraffe
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the Codex App are you using (From “About Codex” dialog)?

OpenAI.Codex_26.609.4994.0_x64

What subscription do you have?

Pro x20

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

I retested on the build that appears to include the fix to issue 24871

  • Codex Desktop package: OpenAI.Codex_26.609.4994.0_x64
  • Bundled AppData CLI: codex-cli 0.140.0-alpha.2
  • Windows sandbox config during normal Desktop testing: [windows] sandbox = "unelevated"
  • [mcp_servers.node_repl] args = [] (no --disable-sandbox workaround)

Good news: the original Desktop/browser symptom appears fixed under the current config.

In a fresh Desktop session:

  • normal shell commands worked
  • node_repl executed successfully
  • Codex in-app browser backend was available and could create/read/close a fresh about:blank
  • Chrome extension backend was available and could create/read/close a fresh about:blank
  • no existing user tabs, URLs, cookies, or page contents were inspected
  • no fresh stdout_eof or os error 740 appeared
  • sandbox log only contained historical May entries for the old os error 740 failure

However, the direct Windows sandbox CLI path still fails on the same machine, even outside Codex Desktop and even from an Administrator PowerShell:

$codex = "C:\Users\<user>\AppData\Local\OpenAI\Codex\bin\<hash>\codex.exe"

& $codex --version
# codex-cli 0.140.0-alpha.2

& $codex -c 'windows.sandbox="unelevated"' sandbox windows -- "$env:WINDIR\System32\cmd.exe" /c echo CODEX_UNELEVATED_ABS_OK
# windows sandbox failed: CreateProcessAsUserW failed: 2

& $codex -c 'windows.sandbox="elevated"' sandbox windows -- "$env:WINDIR\System32\cmd.exe" /c echo CODEX_ELEVATED_ABS_OK
# windows sandbox failed: runner error: CreateProcessAsUserW failed: 2

& $codex -c 'windows.sandbox="elevated"' sandbox windows -- "C:\Program Files\Git\cmd\git.exe" -C "C:\path\to\repo" status --short --branch
# windows sandbox failed: runner error: CreateProcessAsUserW failed: 2

### What steps can reproduce the bug?

PowerShell:

```powershell
$codex = "C:\Users\<user>\AppData\Local\OpenAI\Codex\bin\<hash>\codex.exe"

& $codex --version
# codex-cli 0.140.0-alpha.2

& $codex -c 'windows.sandbox="unelevated"' sandbox windows -- "$env:WINDIR\System32\cmd.exe" /c echo CODEX_UNELEVATED_ABS_OK
# windows sandbox failed: CreateProcessAsUserW failed: 2

& $codex -c 'windows.sandbox="elevated"' sandbox windows -- "$env:WINDIR\System32\cmd.exe" /c echo CODEX_ELEVATED_ABS_OK
# windows sandbox failed: runner error: CreateProcessAsUserW failed: 2

& $codex -c 'windows.sandbox="elevated"' sandbox windows -- "C:\Program Files\Git\cmd\git.exe" -C "C:\path\to\repo" status --short --branch
# windows sandbox failed: runner error: CreateProcessAsUserW failed: 2

### What is the expected behavior?

codex should be able to launch processes to do work

### Additional information

I also tested targeting PowerShell 7 directly:
& $codex -c 'windows.sandbox="unelevated"' sandbox windows -- "C:\Program Files\PowerShell\7\pwsh.exe" -NoProfile -Command "Write-Output CODEX_UNELEVATED_PWSH_OK"
# windows sandbox failed: CreateProcessAsUserW failed: 2
So this looks partially fixed from a Desktop/browser usability perspective, but the direct codex.exe sandbox windows ... runner path still appears broken with CreateProcessAsUserW failed: 2 on 0.140.0-alpha.2.
Is the remaining direct sandbox runner failure expected/known, or should this issue be reopened / split into a follow-up?

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 2 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #27125

Powered by Codex Action

advgiraffe · 2 months ago

Flagged potential dup has different error messages from this although they appear similar

PillarsZhang · 1 month ago

TL;DR: I found the cause of failed: 2. Please try this command first; it may help expose any remaining issues more clearly:

codex -c 'windows.sandbox="elevated"' sandbox cmd /d /c echo CODEX_ELEVATED_OK

It prints:

CODEX_ELEVATED_OK

My debugging:

These commands failed with CreateProcessAsUserW failed: 2:

codex -c 'windows.sandbox="elevated"' sandbox windows -- cmd /d /c echo CODEX_ELEVATED_OK
codex -c 'windows.sandbox="elevated"' sandbox windows cmd /d /c echo CODEX_ELEVATED_OK

Using ProcMon, I found that codex-command-runner-0.142.5.exe was actually launched successfully. The failure happened later because the runner tried to resolve paths like:

windows.exe
windows cmd.exe
windows cmd \d.exe
windows cmd \d \c.exe

So windows is being treated as part of the command to execute.

I also noticed that when Codex is installed via npm install -g @openai/codex, the npm/PowerShell shim can make the ProcMon command line look confusing. In one trace, the final codex.exe command line did not preserve -- exactly as typed. However, I also tested the standalone Windows exe directly and it failed the same way, so the shim does not seem to be the root cause.

I am still not sure when/why this changed, but many examples I found use sandbox windows ..., which seems misleading for current versions.

One more note: during debugging I also cleared these files/directories, but I am not sure whether this affected the final result:

Remove-Item "$env:USERPROFILE\.codex\.sandbox" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item "$env:USERPROFILE\.codex\.sandbox-bin" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item "$env:USERPROFILE\.codex\.sandbox-secrets" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item "$env:USERPROFILE\.codex\cap_sid" -Force -ErrorAction SilentlyContinue

---

Update: If you ran:

codex -c 'windows.sandbox="elevated"' sandbox cmd /d /c echo CODEX_ELEVATED_OK

and then hit the Cannot find the specified module error for codex-windows-sandbox-setup.exe described here: https://github.com/openai/codex/issues/29089

For 0.142.5, clear the four sandbox files/directories as shown above, then let Codex re-trigger the sandbox command from within an interactive chat session. This appears to be related to proxy detection.