Windows standalone auto-upgrade installs a broken AppData CLI launcher without sandbox resources
What version of Codex CLI is running?
codex-cli 0.147.0
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 ARM64
What issue are you seeing?
After the Windows standalone auto-upgrade from 0.146.0 to 0.147.0, codex resolved first to:
%LOCALAPPDATA%\Programs\OpenAI\Codex\bin\codex.exe
The updater copied the new codex.exe and codex-code-mode-host.exe there, but did not install the required codex-resources directory beside that executable. As a result, every sandboxed command failed before PowerShell launched:
windows sandbox: orchestrator_helper_launch_failed:
setup refresh failed to launch helper:
helper=codex-windows-sandbox-setup.exe
error=program not found
The complete versioned release was present under:
%USERPROFILE%\.codex\packages\standalone\releases\0.147.0-aarch64-pc-windows-msvc
and contained:
codex-resources\codex-windows-sandbox-setup.exe
codex-resources\codex-command-runner.exe
The codex.exe in the AppData launcher directory and the versioned release had identical SHA-256 hashes. The difference was solely their resource-relative installation layout.
This leaves a launcher that passes codex --version but cannot execute any sandboxed tool, making the upgrade appear successful while the CLI is functionally broken.
What steps can reproduce the bug?
- Install the standalone Codex CLI on Windows ARM64.
- Allow it to auto-upgrade from 0.146.0 to 0.147.0.
- Confirm both paths exist:
%LOCALAPPDATA%\Programs\OpenAI\Codex\bin\codex.exe%USERPROFILE%\.codex\packages\standalone\releases\0.147.0-aarch64-pc-windows-msvc\bin\codex.exe
- Put the AppData
bindirectory first on PATH, or invoke that executable directly. - Start Codex with the native Windows sandbox.
- Ask it to run a trivial shell command such as
Get-Location.
What is the expected behavior?
The auto-upgrade should leave the public codex entrypoint able to locate the matching version's sandbox setup and command-runner helpers.
The updater could achieve this by installing a resource-aware launcher/shim, preserving the versioned executable location, or installing the matching codex-resources beside the AppData executable.
It should also validate a sandboxed command after upgrade, not only codex --version.
Workaround verified
A small %USERPROFILE%\.local\bin\codex.cmd launcher that selects the newest versioned release and executes its bin\codex.exe fixes the problem.
After restoring that wrapper and restarting Codex:
- sandbox setup launched from the versioned
codex-resourcesdirectory; - writes inside the workspace succeeded;
- writes outside the workspace were denied;
- package formatting, lint, typecheck, and 198 tests passed.
Additional information
The sandbox log clearly distinguishes the broken and working launch paths.
Broken AppData launcher:
setup refresh: spawning codex-windows-sandbox-setup.exe
setup refresh failed to launch helper: ... error=program not found
Working versioned launcher:
setup refresh: spawning %USERPROFILE%\.codex\packages\standalone\releases\0.147.0-aarch64-pc-windows-msvc\codex-resources\codex-windows-sandbox-setup.exe
setup refresh: processed 2 write roots (read roots delegated); errors=[]
setup binary completed
Related: #37049, #32655, #37575. This report focuses specifically on the auto-upgrade completing while leaving the public AppData launcher structurally incomplete.
5 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Same class of pain here — auto-updates half-breaking the install on Windows. FWIW: the standalone auto-updater is usually the culprit; uninstall the AppData launcher and go back to the plain CLI install (or pin the version you know works) until this is sorted. I got burned by broken auto-updates on Hermes and OpenClaw so many times I built a portable USB rescue copy of my agent — runs off the stick, side by side with the broken install, no registry writes. It helped me, might help you: https://github.com/MilkyWay008/Hermes-OTG (built it myself).
Thanks. The suggested duplicate CLI issues do not match my setup:
where.exe codexreturns no result; Codex CLI is not installed.%LOCALAPPDATA%\Programs\OpenAI\Codexdoes not exist.The failure is reproducible in the Desktop App with any command (
Get-Location) before PowerShell starts:helper_unknown_error: setup refresh had errors.Could this be the same helper-resource discovery issue in the Desktop App sandbox rather than the standalone CLI launcher?
Confirming this on Windows x86_64, so the regression is not ARM64-specific.
Environment
10.0.26200.9168, x64codex-cli 0.147.0``
toml
``[windows]
sandbox = "elevated"
codex.exeresolves to:``
text
``%LOCALAPPDATA%\Programs\OpenAI\Codex\bin\codex.exe
Same incomplete launcher layout
The public AppData
bindirectory contains only:It contains neither
codex-resourcesnor the sandbox helpers.The matching versioned standalone release does contain both required files:
Its
codex-pathdirectory contains onlyrg.exe.Running the standalone updater/reinstall reported success but left the public AppData launcher in the same incomplete state.
Repeated failure in the sandbox log
This repeats across repositories and sessions before PowerShell starts:
Using a resource-aware executable resolves the helper and succeeds:
I also verified the complete desktop bundle can resolve both helpers from its versioned directory. Initializing through that executable restored sandbox operation for a resource-aware CLI invocation, while sessions that launch the public AppData
codex.execontinue to fail by bare-name lookup.codex doctorfalse-negativecodex doctor --jsonreturns exit code 0 and:It would be useful for the installation/doctor check to verify that the active public entrypoint can resolve both Windows sandbox helpers, ideally by running a minimal sandboxed command after install/update.
The failure chain is precise on
main@ 1f41cc5d92. The sandbox helper is resolved relative to the running exe — next to it, or incodex-resources/beside it, or<package>/codex-resources/when the exe sits underbin/(windows-sandbox-rs/src/helper_materialization.rs#L194-L212). When none match,find_setup_exefalls back to the bare filename (setup.rs#L846-L853), i.e. a PATH search — which is exactly yourerror=program not found. The updater's%LOCALAPPDATA%\...\bin\codex.exelayout (two exes, nocodex-resources) satisfies none of the three candidates, while the untouched full layout sits under.codex\packages\standalone\releases\....Fix layers:
$CODEX_HOME/packages/standalone/current/codex-resources/<helper>(thecurrentlink is already maintained;install-contextknows the layout) — so a partially-copied launcher degrades gracefully instead of losing the entire sandbox.program not found— three concrete paths in the message would have made this instantly diagnosable.