Skip to content

fix: ensure Homebrew paths are on PATH for Codex CLI detection (#777)#790

Open
byoungd wants to merge 1 commit intopingdotgg:mainfrom
hypeonly:fix/homebrew-codex-cli-detection
Open

fix: ensure Homebrew paths are on PATH for Codex CLI detection (#777)#790
byoungd wants to merge 1 commit intopingdotgg:mainfrom
hypeonly:fix/homebrew-codex-cli-detection

Conversation

@byoungd
Copy link

@byoungd byoungd commented Mar 10, 2026

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

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Append Homebrew and common macOS binary paths to PATH for CLI detection

  • Adds ensureCommonMacPaths() to packages/shared/src/shell.ts, which appends any missing entries from /opt/homebrew/bin, /opt/homebrew/sbin, /usr/local/bin, and /usr/local/sbin to process.env.PATH on darwin, and is a no-op on other platforms.
  • Calls ensureCommonMacPaths() at the end of fixPath() in both apps/desktop/src/fixPath.ts and apps/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.
  • Existing PATH entries are preserved; only missing directories are appended.

Macroscope summarized d0d9020.

…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
@coderabbitai
Copy link

coderabbitai bot commented Mar 10, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b3587404-b859-4db8-a6bd-6ae73db54214

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the vouch:unvouched PR author is not yet trusted in the VOUCHED list. label Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Codex CLI installed via Homebrew is not detected

1 participant