fix: add pnpm/yarn/bun global bin paths and resolve claude CLI for GUI-launched apps#649
Merged
Conversation
…I-launched apps GUI-launched Electron apps don't inherit shell PATH, so spawning bare 'codex' or 'claude' fails for users who installed via pnpm, yarn, or bun. - Generalize resolveCodexCommand() into a shared resolveCommand() that works for any CLI name, and export resolveClaudeCommand() alongside it - Add pnpm global bin dirs (macOS ~/Library/pnpm, Linux ~/.local/share/pnpm, Windows AppData/Local/pnpm) - Add yarn global bin dirs (~/.yarn/bin, Windows AppData/Local/Yarn/bin) - Add bun global bin (~/.bun/bin on all platforms) - Wire claude-pty.ts to use resolveClaudeCommand() instead of bare 'claude' - Simplify Windows PTY spawn to always route through cmd.exe on win32, fixing the bare-command PATHEXT fallback edge case (subsumes #638) Closes #638
This was referenced Apr 14, 2026
Jinwoo-H
added a commit
that referenced
this pull request
Apr 16, 2026
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
4 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.
Summary
resolveCodexCommand()into a sharedresolveCommand()helper, export newresolveClaudeCommand()for the Claude CLIclaude-pty.tsto useresolveClaudeCommand()instead of bare'claude'— fixes the same PATH-inheritance bug that was already fixed for Codexclaude-pty.tsandcodex-fetcher.tsto always route throughcmd.exeon win32, fixing the bare-command PATHEXT fallback edge caseSubsumes and closes #638.
New paths probed
~/Library/pnpm~/.local/share/pnpmAppData/Local/pnpm~/.yarn/bin~/.yarn/binAppData/Local/Yarn/bin~/.bun/bin~/.bun/bin~/.bun/binTest plan