fix: ensure Homebrew paths are on PATH for Codex CLI detection (#777)#790
fix: ensure Homebrew paths are on PATH for Codex CLI detection (#777)#790byoungd wants to merge 1 commit intopingdotgg:mainfrom
Conversation
…otgg#777) On macOS, GUI-launched apps inherit a minimal PATH that excludes Homebrew directories (/opt/homebrew/bin, /usr/local/bin, etc.). The existing fixPath() attempts to read PATH from a login shell, but if this fails (timeout, shell error, etc.), the Codex CLI installed via Homebrew is not found. This adds ensureCommonMacPaths() which appends well-known macOS binary directories to process.env.PATH if they are missing, ensuring tools installed via Homebrew are always discoverable. Closes pingdotgg#777
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
On macOS, GUI-launched apps inherit a minimal PATH that excludes Homebrew directories (/opt/homebrew/bin, /usr/local/bin, etc.).
The existing fixPath() attempts to read PATH from a login shell, but if this fails (timeout, shell error, etc.), the Codex CLI installed via Homebrew is not found.
This adds ensureCommonMacPaths() which appends well-known macOS binary directories to process.env.PATH if they are missing, ensuring tools installed via Homebrew are always discoverable.
Closes #777
What Changed
Why
UI Changes
Checklist
Note
Append Homebrew and common macOS binary paths to PATH for CLI detection
ensureCommonMacPaths()topackages/shared/src/shell.ts, which appends any missing entries from/opt/homebrew/bin,/opt/homebrew/sbin,/usr/local/bin, and/usr/local/sbintoprocess.env.PATHon darwin, and is a no-op on other platforms.ensureCommonMacPaths()at the end offixPath()in bothapps/desktop/src/fixPath.tsandapps/server/src/os-jank.ts, so Homebrew-installed binaries like the Codex CLI are discoverable even when the login-shell PATH probe fails or returns incomplete results.Macroscope summarized d0d9020.