Desktop App cannot start after switching Agent Environment to WSL: "Unable to locate the Codex CLI binary"
What version of the Codex App are you using (From “About Codex” dialog)?
26.616.81150
What subscription do you have?
plus
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
After switching the Agent Environment from Windows to Windows Subsystem for Linux (WSL) in Codex Desktop and restarting the application, the app fails to start the agent.
The following error is displayed:
"Unable to locate the Codex CLI binary.
Set the CODEX_CLI_PATH environment variable to the full path of the Codex CLI binary, or ensure the Electron resources include the binary at bin/codex."
The Codex CLI is already installed inside WSL and works correctly. For example:
wsl --exec /usr/local/bin/codex --version
returns the expected version successfully.
After switching to WSL, the Desktop application cannot proceed past this error, making the WSL Agent Environment unusable.
What steps can reproduce the bug?
Steps to reproduce:
- Install Codex CLI inside WSL.
- Verify it works:
wsl --exec /usr/local/bin/codex --version
- Open Codex Desktop.
- Go to Settings → Agent Environment.
- Select Windows Subsystem for Linux.
- Restart the application.
- The application shows "Unable to locate the Codex CLI binary."
What is the expected behavior?
When WSL is selected as the Agent Environment, Codex Desktop should automatically launch the agent inside the selected WSL distribution without requiring any additional manual configuration.
Since WSL is documented as a supported Agent Environment, I expected the Desktop application to detect and use the installed Codex CLI automatically.
The application should continue to start normally after switching to WSL, without requiring CODEX_CLI_PATH to be configured manually.
Additional information
The Codex CLI itself is working correctly.
For example:
wsl --exec /usr/local/bin/codex --version
returns the expected version successfully.
The issue appears to be that Codex Desktop cannot locate or launch the WSL-installed CLI after switching Agent Environment.
As a result, the application becomes unusable until the WSL setting is manually reverted.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗