You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex. #22423
好像还是不行我直接给config文件删除了,codex走默认的设置了,打开依旧是这个Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.报错
好像还是不行我直接给config文件删除了,codex走默认的设置了,打开依旧是这个Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.报错
好像还是不行我直接给config文件删除了,codex走默认的设置了,打开依旧是这个Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.报错
好像还是不行我直接给config文件删除了,codex走默认的设置了,打开依旧是这个Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.报错
same 同样情况,app里智能体环境改为wsl之后打不开app,app没装在c盘
如果说是需要要能重新打开app页面的话,我是在c盘用户目录里的.codex/config.toml 里删掉
So the Codex CLI works in WSL login shell, but the Windows Codex App cannot discover it after the update.
Before this update, the same WSL setup worked normally. After clicking the in-app update prompt today, the app immediately started failing with this error.
So the Codex CLI works in WSL login shell, but the Windows Codex App cannot discover it after the update.
Before this update, the same WSL setup worked normally. After clicking the in-app update prompt today, the app immediately started failing with this error.
I see the same thing: after updating to 26.609.41114 today, the app fails to start in WSL mode, where it was working before. Setting runCodexInWindowsSubsystemForLinux to false in .codex/config.toml allows it to start - non WSL - but that's not a workaround as I need to use WSL.
I have the same issue. After updating Codex App to 26.609.4994.0 today, the app fails to start in WSL mode.我遇到了相同的问题。今天将 Codex App 更新到 26.609.4994.0 后,该应用在 WSL 模式下无法启动。
**Environment / 环境:**Environment / 环境:
Windows 11
Codex App: OpenAI.Codex_26.609.4994.0_x64__2p2nqsd0c76g0
WSL: Ubuntu, version 2
Agent environment: WSL
Integrated terminal: WSL
Error / 报错:
Unable to locate the Codex CLI binary.
Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.
So the Codex CLI works in WSL login shell, but the Windows Codex App cannot discover it after the update.因此,Codex CLI 在 WSL 登录 shell 中可以正常工作,但更新后 Windows 版 Codex App 无法发现它。
Before this update, the same WSL setup worked normally. After clicking the in-app update prompt today, the app immediately started failing with this error.在此次更新之前,相同的 WSL 设置可以正常运行。今天点击应用内更新提示后,应用立即开始出现此错误。
I see the same thing: after updating to 26.609.41114 today, the app fails to start in WSL mode, where it was working before. Setting runCodexInWindowsSubsystemForLinux to false in .codex/config.toml allows it to start - non WSL - but that's not a workaround as I need to use WSL.我观察到了相同的情况:今天更新到 26.609.41114 后,该应用在之前可以正常工作的 WSL 模式下无法启动。将 .codex/config.toml 中的 runCodexInWindowsSubsystemForLinux 设置为 false 可以使其以非 WSL 模式启动,但这并非一种变通方案,因为我需要使用 WSL。
I also encountered the same problem after the update.
我在更新后也遇到了相同的问题。
临时解决方法:回退 Codex App 至 2026年6月13日 之前的版本,如26.608.12217,这个仓库里面有桌面版安装包的镜像 codex-app-mirror。
Temporary workaround: Roll back the Codex App to a version prior to June 13, 2026, such as 26.608.12217. You can find mirrors for the desktop installers in this repository: codex-app-mirror.
So the Codex CLI works in WSL login shell, but the Windows Codex App cannot discover it after the update.
Before this update, the same WSL setup worked normally. After clicking the in-app update prompt today, the app immediately started failing with this error.
However, if your workspace and development environment are running inside WSL, do not use the executable from that directory. Use the WSL-specific Codex executable located under your .codex\bin\wsl directory instead.
Reacted by Monickar, cls1277, DawnLi, Bret Johnson, Thomas, earli2st and Ricardo-M-String
For me, I didn't have a C:\Users\<YOUR_USERNAME>\.codex\bin\wsl directory (perhaps I used to but I had deleted contents of .codex and apparently the latest Codex app install on Windows doesn't install this).
好像还是不行我直接给config文件删除了,codex走默认的设置了,打开依旧是这个Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.报错
same 同样情况,app里智能体环境改为wsl之后打不开app,app没装在c盘
如果说是需要要能重新打开app页面的话,我是在c盘用户目录里的.codex/config.toml 里删掉
For the same error after updating to Windows x64 26.820.7780.0, there is now at least one regression variant unrelated to the WSL PATH or a user-installed CLI.
In this variant, the earliest log failure is ERROR_ENCRYPTION_FAILED while copying resources\codex.exe, cua_node, and rg.exe from the protected WindowsApps/MSIX package into the per-user cache. "Unable to locate the Codex CLI binary" is only a secondary error. Deleting configuration, setting CODEX_CLI_PATH, or reinstalling the same package generally does not fix this variant.
The current-build report and a verified no-rollback recovery are documented at #40700 (comment). The closely related WSL relocation root cause is tracked in #38696. The recovery does not change WindowsApps ACLs, ownership, or package files.
The complete procedure is relatively involved. If the desktop app cannot start, the simplest option is to give the linked comment to a working Codex CLI on Windows or WSL, or to a ChatGPT desktop session running inside WSL. The agent should first confirm that the machine has the same failure signature, then perform the recovery and validate startup.
Additional Windows reproduction (2026-08-26): the app shows the same startup dialog, Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.
A second failure mode was observed after manually changing the CLI/path configuration as a workaround: Codex could be made to launch, but it then lost the ability to modify project files/code. Reverting away from the path workaround leads back to the startup failure.
This is important because a manual CODEX_CLI_PATH workaround may bind the Desktop app to the wrong runtime (Windows vs WSL) or create a working-directory/sandbox mismatch. A supported recovery path should restore both startup and file-write/edit capability without requiring users to pin CODEX_CLI_PATH to a WindowsApps binary or an incompatible Windows/WSL CLI.
The reported screenshot text exactly matches this issue. App version / sanitized logs can be added once collected.
Activity
vcerfe commentedon May 13, 2026
the same issue I encounter
benname commentedon May 14, 2026
the same issue I encounter
1ceS1amese commentedon May 15, 2026
备份并重置一下codex的设置即可
benname commentedon May 15, 2026
Only way to make it work was to edit .codex-global-state.json and set runCodexInWindowsSubsystemForLinux to false
1ceS1amese commentedon May 15, 2026
thanh125643 commentedon May 15, 2026
i think this dup to this issues #22672
Zhangchunqin commentedon May 16, 2026
me too
Adaozuishuai commentedon May 20, 2026
好像还是不行我直接给config文件删除了,codex走默认的设置了,打开依旧是这个Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.报错
Adaozuishuai commentedon May 20, 2026
然后现在这个app bug界面我点击重新加载,会闪出1秒左右的登录界面,然后我根据指引配置CODEX_CLI_PATH在config文件中依旧如出现此bug 我通过 which codex拿到的路径如下‘/home/wangguangyi/.local/bin/codex’,我 CODEX_CLI_PATH配置就是前面我获取的路径
QwQ-is-not-available commentedon May 22, 2026
same
同样情况,app里智能体环境改为wsl之后打不开app,app没装在c盘
如果说是需要要能重新打开app页面的话,我是在c盘用户目录里的.codex/config.toml 里删掉
之后就能重新打开app了
JunieXD commentedon Jun 9, 2026
打开是能打开了,但又给切回去了,这样改本来是想用wsl的codex,目的没达到啊,都一个月了怎么还没人找到解决方案
thosehow commentedon Jun 9, 2026
the same issue I encounter
QwQ-is-not-available commentedon Jun 9, 2026
记得另外一个issue里提到说把codex app安装位置调整回c盘就正常了;我是直接在wsl2里用codex cli了,感觉还行
3 remaining items
hit-ws commentedon Jun 13, 2026
我也遇到了同样的问题。今天 Codex App 更新到
26.609.4994.0后,原本正常使用的 WSL 模式无法启动。I have the same issue. After updating Codex App to
26.609.4994.0today, the app fails to start in WSL mode.Environment / 环境:
Error / 报错:
Diagnostics / 诊断结果:
From PowerShell:
Output:
But login shell can find Codex:
Output:
So the Codex CLI works in WSL login shell, but the Windows Codex App cannot discover it after the update.
Before this update, the same WSL setup worked normally. After clicking the in-app update prompt today, the app immediately started failing with this error.
中文补充:更新前 WSL 模式一直正常,更新后立刻报错。看起来像是 Codex App 26.609 对 WSL CLI discovery 的启动方式变了,导致非登录 shell 找不到 NVM 里的 codex。
BretJohnson commentedon Jun 13, 2026
I see the same thing: after updating to 26.609.41114 today, the app fails to start in WSL mode, where it was working before. Setting
runCodexInWindowsSubsystemForLinuxto false in.codex/config.tomlallows it to start - non WSL - but that's not a workaround as I need to use WSL.Bagel-Badge commentedon Jun 13, 2026
I also encountered the same problem after the update.
我在更新后也遇到了相同的问题。
临时解决方法:回退 Codex App 至 2026年6月13日 之前的版本,如
26.608.12217,这个仓库里面有桌面版安装包的镜像 codex-app-mirror。Temporary workaround: Roll back the Codex App to a version prior to June 13, 2026, such as 26.608.12217. You can find mirrors for the desktop installers in this repository: codex-app-mirror.
cls1277 commentedon Jun 13, 2026
me too !
cls1277 commentedon Jun 13, 2026
Perhaps you could try this solution. #22672 (comment)
xuetianhao98 commentedon Jun 13, 2026
Environment
Issue and Solution
I encountered the same issue: after Codex was updated, it failed to launch the next time I opened it.
The solution that worked for me was to set the following environment variable in Windows:
After configuring this environment variable, Codex has been working normally.
Important Note
There may be a similar Codex installation under:
However, if your workspace and development environment are running inside WSL, do not use the executable from that directory. Use the WSL-specific Codex executable located under your
.codex\bin\wsldirectory instead.BretJohnson commentedon Jun 13, 2026
For me, I didn't have a
C:\Users\<YOUR_USERNAME>\.codex\bin\wsldirectory (perhaps I used to but I had deleted contents of.codexand apparently the latest Codex app install on Windows doesn't install this).So I ended up going with this workaround: #22672 (comment)
black-yt commentedon Jun 13, 2026
更新 Codex App 后出现:
如果之前在 Codex App 里把 Agent Environment 设置成了 WSL,那么实际上系统里可能同时存在 3 个 Codex:
这是在 Windows 终端里执行
codex用的。例如:
这是你在 Ubuntu/WSL 终端里执行
codex用的。例如:
这是 Codex App 为了桥接 Windows 和 WSL 自动生成的启动器。
问题的根源在于:
很多人会误把环境变量设置到:
或者:
结果会出现各种奇怪错误(
.cmd语法错误、node not found等)。正确修复方法:
先找到 App 自动生成的 WSL Wrapper,找到类似:
然后设置:
验证:
重启 Codex App 即可恢复。
thxzrp commentedon Jun 14, 2026
tive o mesmo problema após atualizar ontem. solução foi setar as variáveis de ambiente de volta ao windows.
bugstan commentedon Jun 14, 2026
same
Thank you @black-yt
LvJohny commentedon Jun 15, 2026
修改回去
runCodexInWindowsSubsystemForLinux = false
integratedTerminalShell = "powershell"
Buzzology commentedon Jun 15, 2026
Same problem
pwnfan commentedon Aug 26, 2026
For the same error after updating to Windows x64
26.820.7780.0, there is now at least one regression variant unrelated to the WSL PATH or a user-installed CLI.In this variant, the earliest log failure is
ERROR_ENCRYPTION_FAILEDwhile copyingresources\codex.exe,cua_node, andrg.exefrom the protected WindowsApps/MSIX package into the per-user cache. "Unable to locate the Codex CLI binary" is only a secondary error. Deleting configuration, settingCODEX_CLI_PATH, or reinstalling the same package generally does not fix this variant.The current-build report and a verified no-rollback recovery are documented at #40700 (comment). The closely related WSL relocation root cause is tracked in #38696. The recovery does not change WindowsApps ACLs, ownership, or package files.
The complete procedure is relatively involved. If the desktop app cannot start, the simplest option is to give the linked comment to a working Codex CLI on Windows or WSL, or to a ChatGPT desktop session running inside WSL. The agent should first confirm that the machine has the same failure signature, then perform the recovery and validate startup.
liangjxiong commentedon Aug 26, 2026
Additional Windows reproduction (2026-08-26): the app shows the same startup dialog,
Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.A second failure mode was observed after manually changing the CLI/path configuration as a workaround: Codex could be made to launch, but it then lost the ability to modify project files/code. Reverting away from the path workaround leads back to the startup failure.
This is important because a manual
CODEX_CLI_PATHworkaround may bind the Desktop app to the wrong runtime (Windows vs WSL) or create a working-directory/sandbox mismatch. A supported recovery path should restore both startup and file-write/edit capability without requiring users to pinCODEX_CLI_PATHto a WindowsApps binary or an incompatible Windows/WSL CLI.The reported screenshot text exactly matches this issue. App version / sanitized logs can be added once collected.
aswordok commentedon Sep 7, 2026
在任务管理器中,展开 ChatGPT 下的没有图标的那个 code.exe(带 .exe 那个),右键打开文件所在的位置,右键 codex.exe,复制文件所在的位置,
setx CODEX_CLI_PATH "C:\Program Files\WindowsApps\OpenAI.Codex_26.901.6511.0_x64__2p2nqsd0c76g0\app\resources\codex.exe"
或者
powershell:
$pkg = Get-AppxPackage OpenAI.Codex
$codexPath = Join-Path $pkg.InstallLocation "app\resources\codex.exe"
[Environment]::SetEnvironmentVariable(
"CODEX_CLI_PATH",
$codexPath,
"User"
)