From d6afb16f00c0b1ead0c687ef96f79bac5ffcf8f9 Mon Sep 17 00:00:00 2001 From: Slobaka <130451520+Slobaka@users.noreply.github.com> Date: Sun, 21 Jun 2026 19:03:18 +0800 Subject: [PATCH] fix(auxiliary): sync missing provider aliases from models.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _PROVIDER_ALIASES in auxiliary_client.py was missing 46 aliases that exist in hermes_cli/models.py (dashscope→alibaba, aws→bedrock, hf→ huggingface, nim→nvidia, deep-seek→deepseek, mimo→xiaomi, etc.). When users configured auxiliary.vision.provider: dashscope (or any of the other missing aliases), _normalize_aux_provider() returned the un-normalized string, causing the vision/compression/web_extract pipeline to silently fail with "couldn't be analyzed" because the provider was not recognized by resolve_provider_client(). Closes #49464 --- agent/auxiliary_client.py | 50 ++++++++++++++++++++++++++++ tests/agent/test_auxiliary_client.py | 41 +++++++++++++++++++++++ 2 files changed, 91 insertions(+) diff --git a/agent/auxiliary_client.py b/agent/auxiliary_client.py index 4bc9440df316..df1ac3b62537 100644 --- a/agent/auxiliary_client.py +++ b/agent/auxiliary_client.py @@ -166,9 +166,15 @@ def _extract_url_query_params(url: str): "google": "gemini", "google-gemini": "gemini", "google-ai-studio": "gemini", + "gemini-cli": "google-gemini-cli", + "gemini-oauth": "google-gemini-cli", "x-ai": "xai", "x.ai": "xai", "grok": "xai", + "grok-oauth": "xai-oauth", + "xai-oauth": "xai-oauth", + "x-ai-oauth": "xai-oauth", + "xai-grok-oauth": "xai-oauth", "glm": "zai", "z-ai": "zai", "z.ai": "zai", @@ -181,6 +187,9 @@ def _extract_url_query_params(url: str): "gmicloud": "gmi", "minimax-china": "minimax-cn", "minimax_cn": "minimax-cn", + "minimax-portal": "minimax-oauth", + "minimax-global": "minimax-oauth", + "minimax_oauth": "minimax-oauth", "claude": "anthropic", "claude-code": "anthropic", "github": "copilot", @@ -193,6 +202,47 @@ def _extract_url_query_params(url: str): "tokenhub": "tencent-tokenhub", "tencent-cloud": "tencent-tokenhub", "tencentmaas": "tencent-tokenhub", + # ── aliases synced from hermes_cli.models._PROVIDER_ALIASES ── + # These were missing, causing auxiliary.vision.provider / auxiliary.compression.provider + # to silently fail when users used common provider aliases (e.g. "dashscope", "qwen", + # "aws", "hf"). See issue #49464. + "dashscope": "alibaba", + "aliyun": "alibaba", + "qwen": "alibaba", + "alibaba-cloud": "alibaba", + "qwen-portal": "qwen-oauth", + "deep-seek": "deepseek", + "step": "stepfun", + "stepfun-coding-plan": "stepfun", + "arcee-ai": "arcee", + "arceeai": "arcee", + "opencode": "opencode-zen", + "zen": "opencode-zen", + "go": "opencode-go", + "opencode-go-sub": "opencode-go", + "kilo": "kilocode", + "kilo-code": "kilocode", + "kilo-gateway": "kilocode", + "hf": "huggingface", + "hugging-face": "huggingface", + "huggingface-hub": "huggingface", + "novita-ai": "novita", + "novitaai": "novita", + "mimo": "xiaomi", + "xiaomi-mimo": "xiaomi", + "aws": "bedrock", + "aws-bedrock": "bedrock", + "amazon-bedrock": "bedrock", + "amazon": "bedrock", + "nim": "nvidia", + "nvidia-nim": "nvidia", + "build-nvidia": "nvidia", + "nemotron": "nvidia", + "lmstudio": "lmstudio", + "lm-studio": "lmstudio", + "lm_studio": "lmstudio", + "ollama": "custom", + "ollama_cloud": "ollama-cloud", } diff --git a/tests/agent/test_auxiliary_client.py b/tests/agent/test_auxiliary_client.py index 8ec6102f2e54..0ee552374755 100644 --- a/tests/agent/test_auxiliary_client.py +++ b/tests/agent/test_auxiliary_client.py @@ -211,6 +211,47 @@ def test_maps_github_copilot_acp_aliases(self): assert _normalize_aux_provider("github-copilot-acp") == "copilot-acp" assert _normalize_aux_provider("copilot-acp-agent") == "copilot-acp" + def test_maps_dashscope_alibaba_aliases(self): + # Regression for #49464 — auxiliary.vision.provider: dashscope + # silently failed because "dashscope" was not in _PROVIDER_ALIASES. + assert _normalize_aux_provider("dashscope") == "alibaba" + assert _normalize_aux_provider("aliyun") == "alibaba" + assert _normalize_aux_provider("qwen") == "alibaba" + assert _normalize_aux_provider("alibaba-cloud") == "alibaba" + + def test_maps_bedrock_aliases(self): + assert _normalize_aux_provider("aws") == "bedrock" + assert _normalize_aux_provider("aws-bedrock") == "bedrock" + assert _normalize_aux_provider("amazon") == "bedrock" + assert _normalize_aux_provider("amazon-bedrock") == "bedrock" + + def test_maps_nvidia_aliases(self): + assert _normalize_aux_provider("nim") == "nvidia" + assert _normalize_aux_provider("nvidia-nim") == "nvidia" + assert _normalize_aux_provider("build-nvidia") == "nvidia" + + def test_maps_huggingface_aliases(self): + assert _normalize_aux_provider("hf") == "huggingface" + assert _normalize_aux_provider("hugging-face") == "huggingface" + assert _normalize_aux_provider("huggingface-hub") == "huggingface" + + def test_maps_deepseek_alias(self): + assert _normalize_aux_provider("deep-seek") == "deepseek" + + def test_maps_xiaomi_aliases(self): + assert _normalize_aux_provider("mimo") == "xiaomi" + assert _normalize_aux_provider("xiaomi-mimo") == "xiaomi" + + def test_maps_opencode_aliases(self): + assert _normalize_aux_provider("opencode") == "opencode-zen" + assert _normalize_aux_provider("zen") == "opencode-zen" + assert _normalize_aux_provider("go") == "opencode-go" + + def test_maps_lmstudio_aliases(self): + assert _normalize_aux_provider("lmstudio") == "lmstudio" + assert _normalize_aux_provider("lm-studio") == "lmstudio" + assert _normalize_aux_provider("lm_studio") == "lmstudio" + class TestReadCodexAccessToken: def test_valid_auth_store(self, tmp_path, monkeypatch):