Skip to content

Fix Windows Codex executable resolution via shutil.which() - #501

Open
grayson-k wants to merge 2 commits into
databricks:mainfrom
grayson-k:fix/windows-codex-launch
Open

Fix Windows Codex executable resolution via shutil.which()#501
grayson-k wants to merge 2 commits into
databricks:mainfrom
grayson-k:fix/windows-codex-launch

Conversation

@grayson-k

@grayson-k grayson-k commented Sep 4, 2026

Copy link
Copy Markdown

Problem

On Windows, Codex installed via npm may only be available as codex.cmd / codex.ps1.

subprocess.run(["codex", ...])

can fail with:

FileNotFoundError: [WinError 2]

even when codex --version works fine in PowerShell.

Fix

Resolve the executable path first using:

shutil.which(binary)

and use the resolved path for both subprocess.run() and exec_or_spawn().

Testing

Tested with:

  • Windows
  • codex-cli 0.153.3
  • ucode 0.1.0+83.g2f993ce

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.

1 participant