From 864752d23f820490b4676de29d3cfe343f9e7c39 Mon Sep 17 00:00:00 2001 From: mitnick Date: Sat, 27 Jun 2026 00:02:43 +0000 Subject: [PATCH] fix(providers): use pipx in install hint to match docs A pipx-installed strix can't add an extra with 'pip install' (wrong env); mirror the documented 'pipx install "strix-agent[...]"' command. Addresses Greptile review. --- strix/interface/main.py | 6 +++--- tests/test_provider_hints.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/strix/interface/main.py b/strix/interface/main.py index f2b73b0f..2925cd22 100644 --- a/strix/interface/main.py +++ b/strix/interface/main.py @@ -214,7 +214,7 @@ def check_docker_installed() -> None: def _provider_import_hint(exc: BaseException, model: str) -> str | None: - """Return a pip-install hint when *exc* is a missing provider dependency. + """Return an install hint when *exc* is a missing provider dependency. Bedrock and Vertex AI ship as optional extras: Bedrock needs ``boto3`` and Vertex AI needs ``google-auth``. When either is absent, litellm raises an @@ -227,9 +227,9 @@ def _provider_import_hint(exc: BaseException, model: str) -> str | None: message = str(exc) model_name = model.lower() if "boto3" in message and model_name.startswith("bedrock/"): - return 'Bedrock support is optional. Install it with: pip install "strix-agent[bedrock]"' + return 'Bedrock support is optional. Install it with: pipx install "strix-agent[bedrock]"' if "google" in message and "vertex" in model_name: - return 'Vertex AI support is optional. Install it with: pip install "strix-agent[vertex]"' + return 'Vertex AI support is optional. Install it with: pipx install "strix-agent[vertex]"' return None diff --git a/tests/test_provider_hints.py b/tests/test_provider_hints.py index 3bad7d99..a71ade99 100644 --- a/tests/test_provider_hints.py +++ b/tests/test_provider_hints.py @@ -9,7 +9,7 @@ def test_bedrock_boto3_hint() -> None: exc = ModuleNotFoundError("No module named 'boto3'") hint = _provider_import_hint(exc, "bedrock/anthropic.claude-4-5-sonnet") assert hint is not None - assert "pip install" in hint + assert 'pipx install "strix-agent[' in hint assert "bedrock" in hint @@ -17,7 +17,7 @@ def test_vertex_google_hint() -> None: exc = ImportError("No module named 'google'") hint = _provider_import_hint(exc, "vertex_ai/gemini-3-pro-preview") assert hint is not None - assert "pip install" in hint + assert 'pipx install "strix-agent[' in hint assert "vertex" in hint