From 4987fd2a596c2d1c0bafaa876ec55c4e32455f22 Mon Sep 17 00:00:00 2001 From: helix4u <4317663+helix4u@users.noreply.github.com> Date: Sun, 24 May 2026 11:41:59 -0600 Subject: [PATCH] fix(model): disambiguate xAI OAuth picker label --- hermes_cli/providers.py | 1 + tests/hermes_cli/test_xai_provider_labels.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 tests/hermes_cli/test_xai_provider_labels.py diff --git a/hermes_cli/providers.py b/hermes_cli/providers.py index 0017004ee08..007a6c3e38b 100644 --- a/hermes_cli/providers.py +++ b/hermes_cli/providers.py @@ -381,6 +381,7 @@ _LABEL_OVERRIDES: Dict[str, str] = { "local": "Local endpoint", "bedrock": "AWS Bedrock", "ollama-cloud": "Ollama Cloud", + "xai-oauth": "xAI Grok OAuth (SuperGrok Subscription)", } diff --git a/tests/hermes_cli/test_xai_provider_labels.py b/tests/hermes_cli/test_xai_provider_labels.py new file mode 100644 index 00000000000..4a64208f2ab --- /dev/null +++ b/tests/hermes_cli/test_xai_provider_labels.py @@ -0,0 +1,16 @@ +"""Regression tests for xAI provider label disambiguation.""" + +from hermes_cli.models import provider_label +from hermes_cli.providers import get_label + + +def test_xai_oauth_provider_label_is_not_collapsed_to_api_key_label(): + """The model picker must distinguish xAI API-key and OAuth providers.""" + assert get_label("xai") == "xAI" + assert get_label("xai-oauth") == "xAI Grok OAuth (SuperGrok Subscription)" + assert get_label("grok-oauth") == "xAI Grok OAuth (SuperGrok Subscription)" + + +def test_xai_oauth_provider_labels_match_canonical_model_labels(): + """Provider helpers should agree on the OAuth display label.""" + assert get_label("xai-oauth") == provider_label("xai-oauth")