Stabilize Codex CLI discovery#72
Conversation
|
@AriaShishegaran I pushed a small follow-up to keep the resolver abstraction while removing the precedence regression. The issue was that fixed Homebrew paths were checked before discovered nvm/PATH installs. On machines that have both, that can run a stale global Homebrew Codex instead of the user-selected nvm/PATH Codex, and it also made the new tests depend on what happened to be installed on the developer/CI machine. The updated ordering keeps Homebrew as a final fallback: explicit/local candidates, PATH/nvm/tool-manager candidates, and the SDK detector all get a chance first. I also made the Homebrew directories injectable in tests so the resolver tests do not depend on the host machine, and added regression coverage for nvm, PATH, and SDK detector candidates winning over Homebrew. Verified with:
|
Summary
codex debug models~/.local/bin/codex), legacy local install, npm user-global prefix, nvm versions, Homebrew, common Node/tool-manager shims, and app-inherited PATH entriesCloses #70
Why
Easel launches Codex from a macOS GUI app process, which may not inherit the user's interactive shell PATH. That made supported installs fail when
codexworked in Terminal but lived outside the previous hardcoded paths.Upstream references checked while preparing this PR:
codexas the run command: https://developers.openai.com/codex/cliCODEX_INSTALL_DIRto$HOME/.local/bin, producing$HOME/.local/bin/codex: https://chatgpt.com/codex/install.shcodex: https://github.com/openai/codex#installing-and-running-codex-cliValidation
swift test --package-path Packages/EaselClaudeCodeUIswift test --package-path Packages/EaselClaudeCodeUI --filter CodexCommandResolverTests~/.npm-global/bin/codex debug modelsreturned model JSONCodexSDKJSON events streaming from a real Easel project with no Codex-not-found errorNotes
Manual installs in arbitrary directories cannot be discovered deterministically by a Finder-launched app. Those remain supported through the explicit Codex command override in settings.