From 145a38a875c0d352c4e14e91ce9992b330240476 Mon Sep 17 00:00:00 2001 From: LLing486 Date: Mon, 27 Apr 2026 01:35:05 +0800 Subject: [PATCH] fix(agent): preserve dots in model names for Xiaomi MiMo provider Add 'xiaomi' to the _anthropic_preserve_dots() provider whitelist and 'xiaomimimo.com' to the URL-based fallback check. Without this, normalize_model_name() converts mimo-v2.5 to mimo-v2-5, which the Xiaomi API rejects with HTTP 400. Fixes #16156 --- run_agent.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/run_agent.py b/run_agent.py index 6d604f9b59..e3823551dc 100644 --- a/run_agent.py +++ b/run_agent.py @@ -8203,6 +8203,7 @@ class AIAgent: """True when using an anthropic-compatible endpoint that preserves dots in model names. Alibaba/DashScope keeps dots (e.g. qwen3.5-plus). MiniMax keeps dots (e.g. MiniMax-M2.7). + Xiaomi MiMo keeps dots (e.g. mimo-v2.5, mimo-v2.5-pro). OpenCode Go/Zen keeps dots for non-Claude models (e.g. minimax-m2.5-free). ZAI/Zhipu keeps dots (e.g. glm-4.7, glm-5.1). AWS Bedrock uses dotted inference-profile IDs @@ -8216,6 +8217,7 @@ class AIAgent: "alibaba", "minimax", "minimax-cn", "opencode-go", "opencode-zen", "zai", "bedrock", + "xiaomi", }: return True base = (getattr(self, "base_url", "") or "").lower() @@ -8225,6 +8227,7 @@ class AIAgent: or "minimax" in base or "opencode.ai/zen/" in base or "bigmodel.cn" in base + or "xiaomimimo.com" in base # AWS Bedrock runtime endpoints — defense-in-depth when # ``provider`` is unset but ``base_url`` still names Bedrock. or "bedrock-runtime." in base