Skip to content

fix: add version manager bin paths to startup PATH for GUI-launched apps - #702

Merged
Jinwoo-H merged 1 commit into
mainfrom
Jinwoo-H/codex-issue-2
Apr 16, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
Jinwoo-H/codex-issue-2

Conversation

@Jinwoo-H

Copy link
Copy Markdown
Contributor

Summary

  • Add Node version manager bin paths (nvm, volta, asdf, fnm, pnpm, yarn, bun, mise) to patchPackagedProcessPath() so node is discoverable when spawning CLI tools from GUI-launched Electron apps
  • Improve ENOENT error messages to distinguish "CLI not found" from "CLI found but node missing" in both codex-accounts/service.ts and rate-limits/codex-fetcher.ts
  • Add mise (formerly rtx) shims directory to version manager probe paths
  • Export getVersionManagerBinPaths() from command.ts for startup PATH augmentation

Root cause

PR #649 fixed finding the codex binary in version manager directories, but spawning it still failed. The codex binary is a shell script with exec node ... — when Orca is launched from Finder/Dock, process.env.PATH is minimal (/usr/bin:/bin:/usr/sbin:/sbin) and doesn't include the directory where node lives. This caused ENOENT, misleadingly reported as "Codex CLI not found."

Reproduction

# Simulates GUI-launched app PATH — fails without fix:
PATH="/usr/bin:/bin:/usr/sbin:/sbin" ~/Library/pnpm/codex --version
# → "exec: node: not found"

# With version manager paths added — succeeds:
PATH="/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin" ~/Library/pnpm/codex --version
# → "codex-cli 0.120.0"

Closes #589

Test plan

GUI-launched Electron apps inherit a minimal PATH that excludes Node
version manager directories (nvm, volta, asdf, fnm, pnpm, yarn, bun,
mise). PR #649 fixed *finding* the codex binary in these directories,
but spawning it still failed because the codex script's shebang
(#!/usr/bin/env node) couldn't locate node.

Augment patchPackagedProcessPath() with version manager bin paths so
node is discoverable for all spawn sites (login, rate limits, usage).
Also improve the ENOENT error message to distinguish "CLI not found"
from "CLI found but node missing" and add mise shims support.

Closes #589
@Jinwoo-H
Jinwoo-H merged commit ca75b16 into main Apr 16, 2026
1 check passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 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.

Can't add codex account; codex cli not found

1 participant