Windows sandbox helper not found in Codex CLI 0.138.0; regression from 0.132.0
What version of Codex CLI is running?
0.138.0
What subscription do you have?
ChatGPT Pro
Which model were you using?
N/A. This reproduces with the local codex sandbox windows command before any model interaction.
What platform is your computer?
Windows 11 x64
What terminal emulator and version are you using (if applicable)?
Windows Terminal with PowerShell 7.6.2
Codex doctor report
What issue are you seeing?
After upgrading to Codex CLI 0.138.0, the Windows sandbox still fails on my machine. This appears related to #24391 and #26158, but it is still reproducible in 0.138.0.
The elevated Windows sandbox path fails while trying to launch Codex's own sandbox setup helper:
windows sandbox failed: orchestrator_helper_launch_failed: setup refresh failed to launch helper: helper=codex-windows-sandbox-setup.exe, cwd=C:\Users\XXXXX, log=C:\Users\XXXXX\.codex\.sandbox\sandbox.2026-06-09.log, error=program not found
The active codex.exe is installed here:
C:\Users\XXXXX\AppData\Local\Programs\OpenAI\Codex\bin\codex.exe
So this does not appear to be the old npm-global package path case. Codex 0.138.0 appears to fall back to the bare helper filename codex-windows-sandbox-setup.exe, and Windows cannot find that helper.
Codex CLI 0.132.0 passed the same sandbox smoke test on this same machine.
What steps can reproduce the bug?
In PowerShell 7.6.2 on Windows:
codex --version
$cmd = "$env:WINDIR\System32\cmd.exe"
codex -c 'windows.sandbox="unelevated"' sandbox windows $cmd /c echo CODEX_UNELEVATED_OK
codex -c 'windows.sandbox="elevated"' sandbox windows $cmd /c echo CODEX_ELEVATED_OK
Actual result on 0.138.0:
codex-cli 0.138.0
For the elevated sandbox command:
windows sandbox failed: orchestrator_helper_launch_failed: setup refresh failed to launch helper: helper=codex-windows-sandbox-setup.exe, cwd=C:\Users\XXXXX, log=C:\Users\XXXXX\.codex\.sandbox\sandbox.2026-06-09.log, error=program not found
Sandbox log excerpt:
[2026-06-08 20:54:22.574 codex.exe] START: windows -- C:\Windows\System32\cmd.exe /c echo CODEX_ELEVATED_OK
[2026-06-08 20:54:23.151 codex.exe] setup refresh: spawning codex-windows-sandbox-setup.exe (cwd=C:\Users\XXXXX, payload_len=5076)
[2026-06-08 20:54:23.157 codex.exe] setup refresh: setup refresh failed to launch helper: helper=codex-windows-sandbox-setup.exe, cwd=C:\Users\XXXXX, log=C:\Users\XXXXX\.codex\.sandbox\sandbox.2026-06-09.log, error=program not found
I also checked the active binary path:
where.exe codex
Get-Command codex | Format-List Source,Path,CommandType,Version
Output:
C:\Users\XXXXX\AppData\Local\Programs\OpenAI\Codex\bin\codex.exe
Source : C:\Users\XXXXX\AppData\Local\Programs\OpenAI\Codex\bin\codex.exe
Path : C:\Users\XXXXX\AppData\Local\Programs\OpenAI\Codex\bin\codex.exe
CommandType : Application
Version : 0.0.0.0
What is the expected behavior?
Both sandbox smoke tests should run successfully and print:
CODEX_UNELEVATED_OK
CODEX_ELEVATED_OK
At minimum, Codex should be able to locate and launch its bundled Windows sandbox helper executable from the active installation directory. The helper should not fall back to the bare filename codex-windows-sandbox-setup.exe unless that executable is actually discoverable on PATH.
Additional information
This looks like 0.138.0 improved the diagnostic message but did not fix the underlying Windows sandbox helper discovery/launch problem on this installation layout.
The important detail is that the active Codex executable is not coming from the npm-global path. It is coming from:
C:\Users\XXXXX\AppData\Local\Programs\OpenAI\Codex\bin\codex.exe
But the sandbox setup refresh logs only:
helper=codex-windows-sandbox-setup.exe
rather than a full path to a helper under the active Codex installation directory.
14 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
For me the Codex CLI exe is in the
C:\Users\XXX\.codex\packages\standalone\releases\0.139.0-x86_64-pc-windows-msvc\bin\codex.exeand the result of any shell command isexecution error: Io(Custom { kind: Other, error: "windows sandbox: orchestrator_helper_launch_failed: setup refresh failed to launch helper: helper=codex-windows-sandbox-setup.exe, cwd=C:\\XXXXThe sandbox setup is in the
C:\Users\XXXX\.codex\packages\standalone\releases\0.139.0-x86_64-pc-windows-msvc\codex-resourcesso this looks like simple path issue.Try 0.140
@valepakh
Same issue on 0.139.0 — still not fixed
Confirming this is still reproducible on Codex CLI 0.139.0 (Windows 11 Pro), so the regression carries over from 0.132.0 through 0.139.0.
In my case it surfaced through the Codex desktop App: it became very slow to start and kept failing. I spent about 3 hours troubleshooting — repeatedly restarting the App and re-checking my setup — before realizing the root cause was the Windows sandbox config compatibility. The error shown was
Couldn't update Agent sandbox / Retry the update, and clicking Retry update never succeeded.Switching the config from:
to:
immediately resolved it and everything works normally again.
So
unelevatedis a working workaround, butelevatedis still broken on 0.139.0. The 0.139.0 changelog doesn't mention any fix for this. Would really appreciate an official fix soon — the failure is silent enough that it cost real debugging time before the sandbox config turned out to be the culprit. Thanks!---
0.139.0 上仍未修复
确认该问题在 Codex CLI 0.139.0(Windows 11 Pro)上依然复现,也就是说这个回归从 0.132.0 一直延续到了 0.139.0。
我这边是通过 Codex 桌面 App 暴露出来的:App 启动变得非常慢并不断失败。我花了大约 3 个小时排查 —— 反复重启 App、反复检查配置 —— 最后才发现根因是 Windows sandbox 配置的兼容性问题。界面报的错是
Couldn't update Agent sandbox / Retry the update,而点击 Retry update 从来没有成功过。把配置从:
改成:
之后立刻恢复正常,一切又能正常工作了。
所以
unelevated是个可用的临时绕过方案,但elevated在 0.139.0 上仍然是坏的。0.139.0 的 changelog 也没提到任何相关修复。希望官方能尽快修复 —— 这个故障足够隐蔽,在最终定位到是 sandbox 配置之前,实实在在浪费了不少调试时间。谢谢!@zouchenzhen
0.140, Try it.
0.140.0 result: launch issue fixed, but a new failure stage appears
Thanks @BaseBlank — I upgraded the CLI to 0.140.0 and tested the elevated sandbox directly with
codex sandbox -c 'windows.sandbox="elevated"'. The failure changed form, which is actually useful signal:orchestrator_helper_launch_failed: setup refresh failed to launch helper ... error=program not found(the helper couldn't be located/launched — the "path issue" @valepakh described).windows sandbox failed: orchestrator_helper_incomplete: setup helper exited successfully before setup completedSo in 0.140.0 the helper is now found and launches successfully (the PathUri refactor seems to have fixed the path/launch problem), but the elevated sandbox still can't be established — it now fails at a later stage: the setup helper exits successfully before setup actually completes.
unelevatedcontinues to work normally on 0.140.0.Environment: Windows 11 Pro x64, Codex CLI installed via npm (
@openai/codex).So this is partial progress: the
program not foundlaunch failure is gone, but elevated provisioning is still broken — just at a different point now. Hope this helps narrow it down. 🙏---
0.140.0 实测:launch 问题已修复,但暴露出新的失败阶段
谢谢 @BaseBlank —— 我把 CLI 升级到了 0.140.0,并用
codex sandbox -c 'windows.sandbox="elevated"'直接测试了 elevated 沙箱。报错的形态变了,这其实是有用的信息:orchestrator_helper_launch_failed: setup refresh failed to launch helper ... error=program not found(helper 找不到/无法启动 —— 正是 @valepakh 描述的"路径问题")。windows sandbox failed: orchestrator_helper_incomplete: setup helper exited successfully before setup completed所以在 0.140.0 里,helper 已经能被找到并成功启动了(看起来 PathUri 重构修好了路径/启动问题),但 elevated 沙箱仍然搭不起来 —— 现在卡在更靠后的阶段:setup helper 正常退出了,却在 setup 真正完成之前就退出了。
unelevated在 0.140.0 上依然正常工作。环境:Windows 11 Pro x64,Codex CLI 通过 npm(
@openai/codex)安装。总之是阶段性进展:
program not found这个 launch 失败已经消失,但 elevated 配置仍然是坏的 —— 只是卡点换了位置。希望这能帮助缩小排查范围。🙏@zouchenzhen
I've noticed this issue as well, and I've already reported it.
Version 0.140 is currently generally functional. Although it fails testing, Codex is able to execute workflows during normal use.
https://github.com/openai/codex/issues/28457
Sigh, Sandbox has been having issues in the last few versions. We'll just have to make do for now and wait for a fix;
As far as I know, the last stable version was 0.132;
Alternatively, we could roll back to 0.132—there haven't been any useful new features lately anyway. Version 0.132 meets my daily needs just fine.
I am on v0.140.0, the error is still reproducible when the sandbox config is
elevated.@wanjuntham
https://github.com/openai/codex/issues/28457
I am still unable to setup admin sandbox in 0.140.0 version after installing it on Windows using the installation script:
#28680
You guys can give it a try.
https://github.com/openai/codex/issues/29089#issuecomment-4765718971
This didn't work for me.
However, I found https://github.com/openai/codex/issues/23194#issuecomment-4692509619. And miraculously, it works!
What I did was:
C:\Users\XXX\.codex\packages\standalone\current\codex-resources, copycodex-command-runner.exeandcodex-windows-sandbox-setup.exe.C:\Users\XXX\.codex\packages\standalone\current\bin.Windows CLI sandbox helper symlink workaround
Quick start powershell command
Scope
This workaround applies to the standalone Codex CLI for Windows when its sandbox helper exists in the installed package but the CLI cannot locate it. It does not apply to the Codex app installed from the Microsoft Store, which has its own installation and resource paths.
The observed failure looked like this:
Cause
In the affected standalone package layout, the CLI entry point is under:
The Windows sandbox resources are under:
The CLI probes for
codex-windows-sandbox-setup.exenext tocodex.exe, under acodex-resourcesdirectory next tocodex.exe, and finally throughPATH. With the layout above, the actual resource directory is one level abovebin, so none of those probes finds it.Workaround
Open an elevated PowerShell session and create a directory symbolic link from the CLI
bindirectory to the package resource directory:Verify the link
Expected properties:
After creating the link, retry a normal Codex tool command without bypassing the sandbox. A working offline sandbox runs under an identity such as
CodexSandboxOfflineand does not have administrator privileges. An online sandbox may use the corresponding online sandbox identity.Update behavior
The visible CLI
bindirectory is a junction into the currently selected standalone release. A CLI update can pointcurrentat a new release whosebindirectory does not contain this symbolic link. If the same helper error returns after an update, inspect the new package layout and recreate the link only if the mismatch still exists.This is a packaging-layout workaround. The long-term correction is for the CLI helper resolver or standalone package layout to agree on the location of
codex-resources.Remove the workaround
Before removing anything, verify that the path is still a symbolic link:
Removing the symbolic link does not remove the target
codex-resourcesdirectory.How to solve
This is not a complex environment issue. It occurs because Codex assumes a Linux-style relationship between the executable and resource directories while the standalone Windows installation uses a different package layout. As a result, the helper lookup overlooks the actual Windows resource path. The simplicity of the root cause makes it surprising that the Windows installation layout was overlooked.
I have this issue on codex-cli 0.144.3