I encountered the same issue: Windows Codex Desktop fails to start with "Unable to locate the Codex CLI binary"
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What version of the Codex App are you using (From “About Codex” dialog)?
Windows Codex Desktop fails to start: "Unable to locate the Codex CLI binary" even though codex.exe is installed and accessible
What subscription do you have?
After launching the Codex Desktop application, it immediately fails with: "ChatGPT failed to start. Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex."
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
Title:
I encountered the same issue: Windows Codex Desktop fails to start with "Unable to locate the Codex CLI binary"
Description:
I encountered the same issue on Windows and would like to provide additional diagnostic information and a workaround.
After launching Codex Desktop, the application fails immediately with:
"ChatGPT failed to start.
Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex."
Environment:
- OS: Windows 11 x64
- Application package: OpenAI.Codex
- Version: 26.820.7780.0
Investigation:
I verified that the Codex CLI installation itself is working correctly.
Standalone Codex CLI path:
C:\Users\lenovo\AppData\Local\Programs\OpenAI\Codex\bin\codex.exe
Running:
codex --version
returns:
codex-cli 0.149.1
I configured the environment variable:
CODEX_CLI_PATH
with:
C:\Users\lenovo\AppData\Local\Programs\OpenAI\Codex\bin\codex.exe
The environment variable is correctly stored and the executable can be launched successfully.
Additional findings:
The installed Windows package contains:
app\resources\codex.exe
but does not contain:
app\resources\bin\codex
The application error message suggests it expects:
resources/bin/codex
but the installed package appears to provide:
resources/codex.exe
I also tested the bundled executable:
app\resources\codex.exe
but executing it directly results in:
ResourceUnavailable
NativeCommandFailed
Access denied
Workaround:
The issue can be temporarily bypassed by installing the standalone Codex CLI and setting:
CODEX_CLI_PATH
to the native executable:
C:\Users\lenovo\AppData\Local\Programs\OpenAI\Codex\bin\codex.exe
After restarting the Windows session and launching Codex Desktop again, the application can locate the CLI successfully.
Expected behavior:
Codex Desktop should either:
- Correctly locate the bundled CLI binary automatically.
or
- Correctly respect CODEX_CLI_PATH during startup.
Possible root cause:
The Windows Electron/MSIX package or startup logic may have a mismatch between the expected CLI location:
resources/bin/codex
and the actual packaged file:
resources/codex.exe
Suggested fixes:
- Ensure the Windows package includes the expected resources/bin/codex binary.
- Fix the startup path resolution logic.
- Ensure CODEX_CLI_PATH is consistently respected on Windows.
- Provide a clearer error message or repair guidance when the bundled binary cannot be executed.
Thank you for investigating this Windows issue.
What steps can reproduce the bug?
Possible root cause:
The Windows Electron/MSIX package or startup logic may have a mismatch between the expected CLI location:
resources/bin/codex
and the actual packaged file:
resources/codex.exe
Suggested fixes:
- Ensure the Windows package includes the expected resources/bin/codex binary.
- Fix the startup path resolution logic.
- Ensure CODEX_CLI_PATH is consistently respected on Windows.
- Provide a clearer error message or repair guidance when the bundled binary cannot be executed.
Thank you for investigating this Windows issue.
What is the expected behavior?
Expected behavior:
Codex Desktop should either:
- Correctly locate the bundled CLI binary automatically.
or
- Correctly respect CODEX_CLI_PATH during startup.
Additional information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the Windows Electron/MSIX packaging and startup path resolution for the bundled CLI. Reproduce with the reported package layout, especially app\resources\codex.exe versus resources/bin/codex, then verify that CODEX_CLI_PATH and the bundled executable are handled consistently on Windows; done means Codex Desktop starts without the reported error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- electron, rust
- Domain
- build-system, desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100