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.
This commit is contained in:
mitnick 2026-06-27 00:02:43 +00:00 • committed by Rome-1
parent 01ce54d4e4
commit 864752d23f
2 changed files with 5 additions and 5 deletions

View file

@ -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

View file

@ -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