Skip to content

fix(codex-discovery): discover macOS Codex installs - #12

Merged
huntharo merged 1 commit into
mainfrom
fix/codex-discovery-chatgpt-app
Jul 9, 2026
Merged

fix(codex-discovery): discover macOS Codex installs#12
huntharo merged 1 commit into
mainfrom
fix/codex-discovery-chatgpt-app

Conversation

@huntharo

@huntharo huntharo commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

PwrAgent Settings can now show macOS Codex installs even when the desktop app is launched with a sparse GUI PATH. Discovery checks current ChatGPT.app bundles, legacy Codex.app bundles, and fixed Homebrew install paths (/opt/homebrew/bin/codex, /usr/local/bin/codex) as known auto-candidates.

This fixes machines where /Applications/ChatGPT.app/Contents/Resources/codex exists but /Applications/Codex.app does not, and also machines where Codex is installed through Homebrew but /opt/homebrew/bin or /usr/local/bin is missing from the Electron launch environment. The Homebrew paths use the same Settings-visible application source as other known install locations, and the existing Homebrew preflight reader can report symlinked Cellar/Caskroom versions without executing when possible.

Normal executable discovery and version sorting still apply across discovered candidates. The returned discovery snapshot continues to expose parsed candidate versions through candidates[].version; callers can read the selected candidate's version, and resolveCodexCommand returns the selected command with its parsed version as well.

Verification

  • pnpm --filter @pwrdrvr/codex-discovery test
  • pnpm --filter @pwrdrvr/codex-discovery typecheck
  • pnpm --filter @pwrdrvr/codex-discovery build
  • Added regression coverage that the deterministic macOS candidate list includes both ChatGPT/Codex app bundles and Homebrew paths.
  • Added regression coverage that parses a codex-cli 0.139.0. banner as 0.139.0 and exposes it on both the selected discovery candidate and resolveCodexCommand.
  • Direct built-package probe with PATH=/usr/bin:/bin:/usr/sbin:/sbin and platform: "darwin" selected /opt/homebrew/bin/codex at 0.144.0, with /Applications/ChatGPT.app/Contents/Resources/codex at 0.144.0-alpha.4 also returned as a Settings-visible application candidate on this machine.

Note: this worktree did not have pnpm on shell PATH, so verification used the repo-pinned pnpm@10.33.0 via npm exec after installing dependencies. @pwrdrvr/agent-core was built first so workspace package exports resolved for the filtered checks.


Compound Engineering
Codex

@huntharo
huntharo force-pushed the fix/codex-discovery-chatgpt-app branch from e25aab4 to 1672263 Compare July 9, 2026 21:21
@huntharo
huntharo force-pushed the fix/codex-discovery-chatgpt-app branch from 1672263 to 09df47d Compare July 9, 2026 21:24
@huntharo huntharo changed the title fix(codex-discovery): discover ChatGPT app bundle fix(codex-discovery): discover macOS Codex installs Jul 9, 2026
@huntharo
huntharo merged commit d46c9dd into main Jul 9, 2026
1 check passed
@huntharo
huntharo deleted the fix/codex-discovery-chatgpt-app branch July 9, 2026 21:33
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