openai / openai/codex

Codex Windows App fails to start: bundled Codex CLI binary exists but cannot be executed

Open
#40,867 12 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug windows-os
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)?

26.820.7780.0

What subscription do you have?

ChatGPT Pro

What platform is your computer?

Windows 11 Home China, OS Build 26200, 64-bit (x64)

What issue are you seeing?

The Codex Windows App fails to start with the following error:

ChatGPT failed to start.
Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.

However, the Codex CLI binary is present inside the installed application package.

I located the following binaries:

C:\Program Files\WindowsApps\OpenAI.Codex_26.820.7780.0_x64__2p2nqsd0c76g0\app\Codex.exe
C:\Program Files\WindowsApps\OpenAI.Codex_26.820.7780.0_x64__2p2nqsd0c76g0\app\resources\codex.exe

I then manually set CODEX_CLI_PATH to the bundled CLI:

$env:CODEX_CLI_PATH="C:\Program Files\WindowsApps\OpenAI.Codex_26.820.7780.0_x64__2p2nqsd0c76g0\app\resources\codex.exe"

When attempting to execute it:

& $env:CODEX_CLI_PATH --version

PowerShell returns:

程序“codex.exe”无法运行: 拒绝访问。
CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
FullyQualifiedErrorId : NativeCommandFailed

The Chinese error message means that codex.exe cannot be executed because access is denied.

Therefore, the bundled CLI binary appears to exist, but the Codex App cannot locate or execute it successfully.

What steps can reproduce the bug?
  1. Install or update the Codex Windows App to version 26.820.7780.0.
  2. Launch the Codex App.
  3. The app fails to start and displays:
Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.
  1. Open PowerShell and locate the bundled CLI:
$pkg = Get-AppxPackage OpenAI.Codex
Get-ChildItem $pkg.InstallLocation -Recurse -Filter "codex.exe" -ErrorAction SilentlyContinue | Select-Object FullName
  1. Observe that app\resources\codex.exe exists.
  2. Set CODEX_CLI_PATH to that executable.
  3. Run:
& $env:CODEX_CLI_PATH --version
  1. PowerShell returns an Access denied error and the executable cannot be launched.

I have not modified the permissions or ACLs under C:\Program Files\WindowsApps.

What is the expected behavior?

No response

Additional information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the Windows app's CLI binary discovery and process launch using CODEX_CLI_PATH, the packaged app/resources/codex.exe path, and the Electron resources layout. Reproduce the failure with the supplied PowerShell command and AppX installation steps. Done when the installed app locates and successfully launches its bundled CLI without the access-denied failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, rust
Domain
build-system, cli, desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.