Skip to content

fix: resolve codex-acp binary path on Windows by appending .exe extension#2444

Merged
k11kirky merged 1 commit into
PostHog:mainfrom
Basit-Balogun10:fix/codex-acp-windows-exe-extension
Jun 1, 2026
Merged

fix: resolve codex-acp binary path on Windows by appending .exe extension#2444
k11kirky merged 1 commit into
PostHog:mainfrom
Basit-Balogun10:fix/codex-acp-windows-exe-extension

Conversation

@Basit-Balogun10
Copy link
Copy Markdown
Contributor

@Basit-Balogun10 Basit-Balogun10 commented Jun 1, 2026

Problem

Closes #2445

On Windows, getCodexBinaryPath() looks for the binary at .vite/build/codex-acp/codex-acp — without the .exe extension. The file on disk is codex-acp.exe, so the lookup always fails and the Codex adapter cannot start.

The error thrown is:

codex-acp binary not found at ...\apps\code\.vite\build\codex-acp\codex-acp.
Run "node apps/code/scripts/download-binaries.mjs" to download it.

This causes the session to fall back to Claude silently, even when the user has explicitly selected a Codex/OpenAI model and the binary is present.

Note: the Claude binary path (line 341) already handles this correctly with a platform check — this fix applies the same pattern to the Codex binary.

Changes

Added a process.platform === "win32" check to getCodexBinaryPath(), matching the existing pattern in getClaudeBinaryPath():

// Before
private getCodexBinaryPath(): string {
  return this.bundledResources.resolve(".vite/build/codex-acp/codex-acp");
}

// After
private getCodexBinaryPath(): string {
  const binary = process.platform === "win32" ? "codex-acp.exe" : "codex-acp";
  return this.bundledResources.resolve(`.vite/build/codex-acp/${binary}`);
}

How did you test this?

Tested manually on Windows 11 (WSL2 dev environment) running the dev build (pnpm start from the worktree):

  1. Downloaded codex-acp.exe via node apps/code/scripts/download-binaries.mjs
  2. Before fix: selecting a Codex model (gpt-5.4) at task creation always fell back to Claude with the binary-not-found error in logs
  3. After fix: [CodexAcpAgent] Spawning codex-acp process appears in logs, task runs successfully through OpenAI

Publish to changelog?

no

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 1, 2026

Reviews (1): Last reviewed commit: "fix: resolve codex-acp binary path on Wi..." | Re-trigger Greptile

Copy link
Copy Markdown
Contributor

@k11kirky k11kirky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@k11kirky
Copy link
Copy Markdown
Contributor

k11kirky commented Jun 1, 2026

Hey @Basit-Balogun10 - you will need to sign these commits in order for us to merge it, or ill have to recreate the change with a signed commit of my own (which will remove your contribution label)

@Basit-Balogun10 Basit-Balogun10 force-pushed the fix/codex-acp-windows-exe-extension branch from 2b72838 to eb387d6 Compare June 1, 2026 10:46
@Basit-Balogun10
Copy link
Copy Markdown
Contributor Author

Hi @k11kirky
Thanks, just signed the commit!

@k11kirky
Copy link
Copy Markdown
Contributor

k11kirky commented Jun 1, 2026

@Basit-Balogun10 Thanks, youll need to do that with the other PR's too!

@Basit-Balogun10
Copy link
Copy Markdown
Contributor Author

Oh yeah, on it already, thanks!

@k11kirky k11kirky merged commit 574516e into PostHog:main Jun 1, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: codex-acp binary path missing .exe extension on Windows

2 participants