Skip to content

fix(transport): prioritize system-wide CLI over bundled binary in _find_cli#970

Open
anishesg wants to merge 1 commit into
anthropics:mainfrom
proudhare:fix/ph-issue-922
Open

fix(transport): prioritize system-wide CLI over bundled binary in _find_cli#970
anishesg wants to merge 1 commit into
anthropics:mainfrom
proudhare:fix/ph-issue-922

Conversation

@anishesg
Copy link
Copy Markdown

Changed the CLI discovery order in SubprocessCLITransport._find_cli() to search for system-wide installations (via PATH and common locations) before falling back to the bundled binary. This allows users to work around protocol incompatibilities in older bundled binaries by installing a newer version globally, without requiring an SDK upgrade.

The original priority order checked the bundled CLI first, which prevented users from overriding a broken bundled binary. In containerized environments where the bundled binary v2.1.121 fails to respond to control_request:initialize messages, users can now install v2.1.128+ via npm and the SDK will automatically discover and use the working version.

The new search order:

  1. System-wide PATH (shutil.which("cli"))
  2. Common installation locations (.npm-global/bin, /usr/local/bin, etc.)
  3. Bundled CLI (fallback for environments without system installation)

Fixes #922

…nd_cli

Changed the CLI discovery order in `SubprocessCLITransport._find_cli()` to search for system-wide installations (via PATH and common locations) before falling back to the bundled binary. This allows users to work around protocol incompatibilities in older bundled binaries by installing a newer version globally, without requiring an SDK upgrade.

Signed-off-by: anish <anishesg@users.noreply.github.com>
@anishesg anishesg marked this pull request as ready for review May 20, 2026 10:00
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.

_bundled/claude v2.1.121 protocol-incompatible in container env (silent timeout on control_request:initialize)

1 participant