Skip to content

Fix menubar installer CLI path lookup#387

Merged
iamtoruk merged 2 commits into
getagentseal:mainfrom
ozymandiashh:fix/issue-384-menubar-env
May 24, 2026
Merged

Fix menubar installer CLI path lookup#387
iamtoruk merged 2 commits into
getagentseal:mainfrom
ozymandiashh:fix/issue-384-menubar-env

Conversation

@ozymandiashh
Copy link
Copy Markdown
Contributor

Summary

Closes #384 by making the macOS menubar installer resolve a persistent codeburn binary from the caller's real PATH instead of a hard-coded Homebrew/system-only PATH.

Root cause

codeburn menubar persists the CLI path so the installed Swift menubar app can keep launching codeburn later from a GUI process. The lookup used:

/usr/bin/env PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin which codeburn

That drops the PATH that successfully launched the installer. Users with global installs under Node version managers such as nvm, fnm, volta, or asdf can run codeburn menubar from their shell, but the installer lookup cannot see that codeburn binary and reports the raw subprocess failure:

Menubar install failed: /usr/bin/env exited with status 1

It also only looked at the first which match, so a transient npx shim could mask a later persistent install.

What changed

  • Preserve the caller's PATH when resolving the persistent codeburn command.
  • Append the existing GUI-friendly fallback paths (/opt/homebrew/bin, /usr/local/bin, /usr/bin, /bin) without dropping user Node-manager paths.
  • Switch from which codeburn to which -a codeburn and choose the first absolute non-npx match.
  • Convert lookup failures into the existing actionable install guidance instead of exposing /usr/bin/env exited with status 1.
  • Add regression coverage for nvm-style PATH preservation, npx-first lookup output, and the only-npx error path.

Validation

Concrete fixture for the bug path:

lookup PATH input:
/Users/me/.nvm/versions/node/v22.13.0/bin:/usr/bin

which -a output:
/Users/me/.npm/_npx/abcd/node_modules/.bin/codeburn
/Users/me/.nvm/versions/node/v22.13.0/bin/codeburn

Before this change, the installer used a fixed PATH and could not see the nvm entry. With an unavailable lookup, the user-facing CLI error was:

Menubar install failed: /usr/bin/env exited with status 1

After this change, the same lookup shape keeps the caller PATH and selects the persistent binary:

selected: /Users/me/.nvm/versions/node/v22.13.0/bin/codeburn

The only-npx case now returns actionable guidance instead of the raw env failure:

The menubar app needs a persistent codeburn command. Install CodeBurn globally first: npm install -g codeburn

Checks:

npm test -- tests/cli-status-menubar.test.ts --run
npm test -- tests/menubar-installer.test.ts
npm test -- --run
npm run build
git diff --check
Claude Opus 4.7 effort max review - PASS
Gemini 3.5 Flash High review via agy CLI - PASS

Notes:

  • Full suite after restoring the generated LiteLLM snapshot: 65 files, 927 tests passed.
  • npm run build passes and regenerates src/data/litellm-snapshot.json; that generated snapshot refresh was restored because it is unrelated to this fix.

resolvePersistentCodeburnPathFromWhichOutput already guarantees
the returned path is absolute and non-npx.
@iamtoruk iamtoruk merged commit c687595 into getagentseal:main May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Menubar installing error

2 participants