fix(desktop): complete backend PATH for Homebrew Codex - #44814
Merged
teknium1 merged 1 commit intoJun 12, 2026
Conversation
macOS Desktop backend processes can still miss Apple Silicon Homebrew paths even after adding Hermes-managed Node and venv bins. That leaves `/codex-runtime on` unable to find a Homebrew-installed `codex` binary at `/opt/homebrew/bin/codex`. Add a small testable backend env helper that builds the dashboard subprocess environment in one place. It prepends Hermes-managed Node and venv bins, appends missing POSIX sane PATH entries individually, preserves caller precedence without duplicates, and keeps Windows PATH casing/delimiters intact. Wire both source-checkout and active-install backend descriptors through the helper, and add Node regression coverage to the desktop platform test suite.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #44813
Summary
/codex-runtime onin the macOS Desktop app can still fail whencodexis installed via Homebrew at/opt/homebrew/bin/codex. The Desktop dashboard backend PATH may include Hermes-managed bins and the default Apple paths, while still missing Apple Silicon Homebrew.This follows the two existing fixes in the same bug family:
~/.hermes/node/bin/codexis discoverable.What changed
apps/desktop/electron/backend-env.cjs:~/.hermes/node/binand the backend venv bin;/opt/homebrew/bin,/opt/homebrew/sbin,/usr/local/sbin, etc.);;delimiters.createPythonBackend()for explicit/dev source checkouts;createActiveBackend()for the installed active checkout.apps/desktop/electron/backend-env.test.cjsand included it intest:desktop:platforms.Behavior change
A GUI-launched Desktop backend with a minimal macOS PATH can now discover both:
~/.hermes/node/bin/codex;/opt/homebrew/bin/codex.That lets
/codex-runtime onenablecodex_app_serverwhen Codex is installed through Homebrew.Tests
Risk / scope
This only affects the Electron Desktop backend subprocess environment. It does not change the model tool schema or terminal tool execution path. Windows behavior is covered by a regression test for PATH casing and delimiter preservation.
Infographic