Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions agent/auxiliary_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
}


Expand Down
41 changes: 41 additions & 0 deletions tests/agent/test_auxiliary_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Loading