Repository navigation
Description
What happened?
On the Windows Codex app, sandboxed commands started failing before the requested command ran. The initial failure was that the sandbox setup helper could not be launched:
windows sandbox: orchestrator_helper_launch_failed: setup refresh failed to launch helper: helper=codex-windows-sandbox-setup.exe, cwd=C:\Program Files\WindowsApps\OpenAI.Codex_26.623.9142.0_x64__2p2nqsd0c76g0\app, log=%USERPROFILE%\.codex\.sandbox\sandbox.2026-06-30.log, error=program not found
The helper binary exists, but under app\resources rather than directly under app or a directory on PATH:
C:\Program Files\WindowsApps\OpenAI.Codex_26.623.9142.0_x64__2p2nqsd0c76g0\app\resources\codex-windows-sandbox-setup.exe
After copying codex-windows-sandbox-setup.exe to the active Codex user bin directory on PATH, setup completed, but the next sandbox run failed with:
windows sandbox: CreateProcessWithLogonW failed: 2
The sandbox log then showed the command runner lookup falling back to the legacy name:
helper copy failed for command-runner: helper not found next to current executable or under codex-resources: %LOCALAPPDATA%\OpenAI\Codex\bin\<hash>\codex.exe; falling back to legacy path codex-command-runner.exe
codex-command-runner.exe also exists under app\resources, but was not discoverable from the active user bin/PATH location.
Expected behavior
Sandboxed commands should run without manually copying helper binaries. The launcher should either:
- look in
app\resourcesforcodex-windows-sandbox-setup.exeandcodex-command-runner.exe, or - package/copy those helpers next to the executable/path location where the launcher expects them.
Actual behavior
Any sandboxed command failed before execution because codex-windows-sandbox-setup.exe was not found. After manually making that helper discoverable, sandbox setup completed but command execution failed because codex-command-runner.exe was not found.
Workaround
Copying both helper binaries from app\resources into the active Codex user bin directory made sandboxed commands work again:
Copy-Item "<Codex WindowsApps package>\app\resources\codex-windows-sandbox-setup.exe" "<active %LOCALAPPDATA%\OpenAI\Codex\bin\hash>\codex-windows-sandbox-setup.exe" -Force
Copy-Item "<Codex WindowsApps package>\app\resources\codex-command-runner.exe" "<active %LOCALAPPDATA%\OpenAI\Codex\bin\hash>\codex-command-runner.exe" -ForceAfter this, simple sandboxed commands such as Get-Location and git status --short ran successfully.
Environment
- OS: Windows native Codex app
- Codex app package observed:
OpenAI.Codex_26.623.9142.0_x64__2p2nqsd0c76g0 - Sandbox mode:
workspace-write, Windows native sandbox - Date observed: 2026-06-30
Notes
This looks like a packaging or helper lookup path regression: the required helper binaries are present in the app package, but the runtime lookup path does not include their packaged location.
Activity
github-actions commentedon Jun 30, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
arteagacz commentedon Jun 30, 2026
Same here. And restarting Codex did not fix it. This happens in all modes (full access, custom, any...).
What I tested after the restart:
PowerShell command:
Write-Output 'ok'; Get-Location
from C:\somefolder\somefolder2
cmd.exe command:
echo ok && cd
from C:\somefolder\somefolder2
Both failed before the shell started, with the same Codex-side error:
Failed to create unified exec process: helper_unknown_error: setup refresh had errors
arteagacz commentedon Jun 30, 2026
Same issue with CLI
starriet9 commentedon Jul 6, 2026
I hit the same helper-discovery class of failure with the standalone Windows CLI install, and I think there is one more path shape involved: the standalone installer exposes
codex.exethrough a visiblebindirectory that is a Windows junction to the actual releasebindirectory.Observed layout, with user-specific parts omitted:
In this layout the helpers are present, but lookup from the visible
current_exe()path checks around:That misses the actual release
codex-resourcesdirectory. If the executable path is canonicalized first, the lookup resolves through the junction to the real releasebin, and../codex-resourcesfinds both helper binaries.I prepared a candidate fix here:
https://github.com/starriet9/codex/tree/fix/windows-sandbox-helper-junction
Commit:
The patch keeps the existing literal lookup first, then falls back to the same lookup using
dunce::canonicalize(exe)when the helper was not found. That should preserve existing layouts while fixing the standalone junction layout.Local validation:
I also verified the path behavior with an isolated Windows junction probe: literal lookup from the visible junction path missed both helpers, while the canonicalized fallback found both helpers under the release
codex-resourcesdirectory.I am not opening a PR yet because
docs/contributing.mdsays external PRs are by invitation only. If this direction matches the intended packaging/runtime behavior, I can open a focused PR from the branch above.mon-jai commentedon Jul 14, 2026
The following command fixes my
install.ps1installation.TL;DR: This command identifies the most recent release directory (to which
~/.codex/packages/standalone/currentis junction-linked) and creates hard links of<release>/codex-resources/{codex-command-runner.exe,codex-windows-sandbox-setup.exe}to the<release>/bin/directory.One liner:
Loongtech commentedon Jul 30, 2026
I can reproduce the same helper-discovery failure with the Microsoft Store Windows app, and it is intermittent within the same installed version.
Environment:
OpenAI.Codex_26.721.11231.0_x64__2p2nqsd0c76g0Observed failure:
The package contains both helpers at:
The most useful contrast is in the sandbox log on the same day:
spawning C:\Program Files\WindowsApps\OpenAI.Codex_26.721.11231.0_x64__2p2nqsd0c76g0\app\resources\codex-windows-sandbox-setup.exe, followed bysetup binary completed.spawning codex-windows-sandbox-setup.exe, followed byprogram not found.So the executable is present and can be launched when the resolver uses its absolute packaged resource path; the intermittent failure appears to fall back to a bare filename that is not on PATH. I counted 131 instances of this specific launch failure in my sandbox logs from July 15–30 (24 in the latest seven days). I found no matching Microsoft Defender quarantine/block event.
This appears to be the same root cause as this issue, with the newer Store package and a particularly clear absolute-path vs bare-name comparison.