Skip to content

Fix Codex Desktop CLI resolution on Windows - #75

Merged
zuiho-kai merged 1 commit into
InferMatrixLab:mainfrom
congw729:codex/fix-windows-codex-cli-resolution
Aug 14, 2026
Merged

zuiho-kai merged 1 commit into
InferMatrixLab:mainfrom
congw729:codex/fix-windows-codex-cli-resolution

Conversation

@congw729

Copy link
Copy Markdown
Contributor

Summary

  • prefer the usable Codex Desktop CLI exposed by CODEX_CLI_PATH
  • fall back to shutil.which("codex") for regular CLI installations
  • cover both resolution paths with installer unit tests

Root cause

On Microsoft Store Codex Desktop installations, shutil.which("codex") can resolve to a packaged executable under C:\Program Files\WindowsApps. That path is discoverable but cannot necessarily be launched by the installer's Python child process, causing PermissionError: [WinError 5] Access is denied during MCP registration.

Codex Desktop already exports the actual callable CLI through CODEX_CLI_PATH; the installer was not consulting it.

User impact

install.cmd now works from Codex Desktop without requiring users to manually prepend the internal CLI directory to PATH. Existing standalone Codex CLI installations retain the previous PATH-based behavior.

Validation

  • uv run --with-editable . --with pytest pytest -q test/test_install_mcp_script.py — 8 passed
  • git diff --check

Closes #74

@congw729
congw729 force-pushed the codex/fix-windows-codex-cli-resolution branch from fc7f3ae to 23de61b Compare August 13, 2026 18:30
@congw729
congw729 marked this pull request as ready for review August 13, 2026 18:31
@congw729

Copy link
Copy Markdown
Contributor Author

@TaffyOfficial

@zuiho-kai
zuiho-kai merged commit b9a24b9 into InferMatrixLab:main Aug 14, 2026
1 check 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.

Windows installer fails when codex resolves to the inaccessible WindowsApps executable

2 participants