fix(desktop): extend PATH for dashboard backend so codex is discoverable on macOS - #41389
Closed
liuhao1024 wants to merge 1 commit into
Closed
fix(desktop): extend PATH for dashboard backend so codex is discoverable on macOS#41389liuhao1024 wants to merge 1 commit into
liuhao1024 wants to merge 1 commit into
Conversation
…ble on macOS macOS GUI apps launched via Launch Services (Finder/Dock) inherit a minimal PATH (/usr/bin:/bin:/usr/sbin:/sbin) that does not include ~/.hermes/node/bin. When the Electron desktop spawns the Python dashboard backend, this minimal PATH propagates to the child process, causing check_codex_binary() to fail with 'codex CLI not found' even though codex is installed at ~/.hermes/node/bin/codex. Add PATH extension (HERMES_HOME/node/bin + venv/bin) to the env object in both createPythonBackend() and createActiveBackend(), matching the existing pattern used by the self-update spawn path (line 1627). Fixes NousResearch#41385
This was referenced Jun 12, 2026
Contributor
|
Closing in favor of PR #44814, which just merged and supersedes this change — it includes the same Your diagnosis of #41385 and the fix direction were correct and directly informed the final shape. Appreciate the contribution. |
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.
Summary
macOS GUI apps launched via Launch Services (Finder/Dock) inherit a minimal
PATH(/usr/bin:/bin:/usr/sbin:/sbin) that does not include~/.hermes/node/bin. When the Electron desktop spawns the Python dashboard backend, this minimal PATH propagates to the child process, causingcheck_codex_binary()inagent/transports/codex_app_server.pyto fail with:Even though
codexis already installed at~/.hermes/node/bin/codex(Hermes's own bundled Node).Fixes #41385
Root Cause
The self-update spawn path already extends PATH (line 1627 of
main.cjs):But
createPythonBackend()andcreateActiveBackend()— the two functions that build the dashboard backend descriptor — only setPYTHONPATHin theirenvobject, leavingPATHat the inherited minimal value.Fix
Add
PATHextension to theenvobject in bothcreatePythonBackend()andcreateActiveBackend(), prepending:~/.hermes/node/bin(for codex and other Hermes-managed Node binaries)venv/bin(for the Python venv, when it exists)This matches the existing pattern used by the self-update spawn and the per-profile backend spawn paths.
Test Plan
tests/test_desktop_dashboard_path.pyverifying both functions includenode/binin PATHpytest tests/test_desktop_dashboard_path.py— 2/2 passed/codex-runtime on— should succeed