fix: binary detection: prioritize native installer over stale Homebrew/npm paths#33
Open
BennettSchwartz wants to merge 1 commit intolcoutodemos:mainfrom
Open
Conversation
…/npm paths
The native installer (~/.local/bin/claude) is now the officially
recommended install method, but the detection logic checked
/opt/homebrew/bin and /usr/local/bin first. This caused failures
when a stale old version (e.g. v1.0.34) existed at those paths,
shadowing the current install and producing 'unknown option
--include-partial-messages' errors.
Changes:
- Extract shared findClaudeBinary() into find-binary.ts to
eliminate triple-duplicated logic across run-manager, pty-run-manager,
and process-manager
- Reorder detection: native path → shell-resolved (whence/which) →
hardcoded fallbacks → bare 'claude'
- Replace execSync('test -x ...') with fs.accessSync(X_OK) to
avoid shell invocation
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
~/.local/bin/claude) is the officially recommended install method, but_findClaudeBinary()checked/opt/homebrew/binand/usr/local/binfirst. A stale old version (e.g. v1.0.34 via Homebrew) at those paths would shadow the current install, causingunknown option '--include-partial-messages'errors at runtime.run-manager.ts,pty-run-manager.ts, andprocess-manager.tsinto a sharedfind-binary.tsmodule.claude.execSync('test -x ...')withfs.accessSync(X_OK)to avoid unnecessary shell invocation.Test plan
~/.local/bin/claude(native install)claudeis on PATH (bare command fallback)