-
Notifications
You must be signed in to change notification settings - Fork 246
Description
Problem
In the packaged macOS/Linux app, Maestro can detect Node-backed CLIs like Codex from Node version manager installs (nvm, fnm, etc.), but still fail to launch them at runtime.
A common failure looks like this:
- Maestro detects
codexsuccessfully - Launching a Codex session exits immediately
- Stderr shows:
env: node: No such file or directory
Reproduction
- Install
codexunder a Node version manager path such as~/.nvm/.../bin/codex - Launch the packaged Maestro app (not
npm run dev) - Start a Codex agent session
Expected
If agent detection finds codex, the spawned process environment should also contain the corresponding Node bin directory so the wrapper script can resolve node.
Actual
The packaged app’s spawn environment did not include detected version manager bin directories, so codex could be found but its internal node lookup failed.
Root Cause
There was a mismatch between:
- agent detection, which probes version manager locations directly
- child-process PATH expansion, which previously omitted those detected version manager bin directories
There was also a precedence issue when prepending PATH entries: earlier entries could be reversed unintentionally, so nvm/current/bin would not reliably stay ahead of versioned installs.
Impact
This affects packaged-app launches for Node-backed tools installed outside the default GUI PATH, especially on macOS where GUI apps do not inherit shell PATH reliably.
Fix
- Include detected Node version manager bin directories in the shared expanded PATH
- Preserve intended PATH precedence when prepending entries
- Add regression tests for both:
- the shared PATH builder
- the child-process environment builder