hermes - ✅(Solved) Fix Xiaomi/MiMo models require preserve_dots=True to keep model name format [2 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#15619Fetched 2026-04-26 05:26:08
View on GitHub
Comments
0
Participants
1
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
labeled ×4cross-referenced ×2

Error Message

Xiaomi's MiMo models use dots in model names (e.g., mimo-v2.5-pro), but Hermes automatically converts dots to hyphens for all Anthropic-compatible endpoints, resulting in mimo-v2-5-pro being sent to the API, causing a 400 error. 3. Observe the error: {'error': {'code': '400', 'message': 'Not supported model mimo-v2-5-pro', 'param': 'Param Incorrect'}}

Root Cause

In run_agent.py, the _anthropic_preserve_dots() method determines whether to preserve dots in model names. The logic converts dots to hyphens for all providers except those in the whitelist:

# Line 7243-7248
if (getattr(self, "provider", "") or "").lower() in {
    "alibaba", "minimax", "minimax-cn",
    "opencode-go", "opencode-zen",
    "zai", "bedrock",
}:
    return True

Xiaomi is not in this list, so mimo-v2.5-pro becomes mimo-v2-5-pro.

Fix Action

Fixed

PR fix notes

PR #15637: fix(model-normalize): add xiaomi to preserve-dots allowlist (#15619)

Description (problem / solution / changelog)

Summary

  • Add "xiaomi" to the _anthropic_preserve_dots() provider allowlist in run_agent.py
  • Add "xiaomimimo.com" to the base-URL heuristic (defense-in-depth for deployments where provider= is not explicitly set)
  • Add 8 tests covering provider-name match, case-insensitivity, base-URL match, negative canaries, and end-to-end normalize_model_name behavior

The bug

Xiaomi's MiMo models use dots in their version strings (e.g. mimo-v2.5-pro). The Anthropic SDK adapter converts dots to hyphens by default, producing mimo-v2-5-pro, which the Xiaomi API rejects with:

HTTP 400: Not supported model mimo-v2-5-pro

The _anthropic_preserve_dots() method controls this behavior with a provider allowlist. Xiaomi was absent from the list, while structurally identical providers — MiniMax (MiniMax-M2.7), ZAI/Zhipu (glm-4.7), AWS Bedrock (global.anthropic.claude-opus-4-7) — were already included.

The fix

Added "xiaomi" to the provider-name set and "xiaomimimo.com" to the base-URL heuristic, mirroring the pattern used for Bedrock (commit f77be22c) and MiniMax. One-line change in run_agent.py — no logic change, only extending the allowlist.

Test plan

  • Before: 3 tests fail (test_xiaomi_provider_name_preserves_dots, test_xiaomi_provider_case_insensitive, test_xiaomimimo_base_url_preserves_dots) — all with AssertionError: assert False is True
  • After: 8 passed, 0 failed
  • Regression guard: reverted the fix → 3 failures with exact expected error; restored → 8/8 passed
  • tests/agent/test_bedrock_integration.py — 55 passed, unchanged
  • tests/agent/test_anthropic_adapter.py — same 10 pre-existing failures as clean origin/main, zero new

Related

  • Fixes #15619

🤖 Generated with Claude Code

Changed files

  • run_agent.py (modified, +6/-1)
  • tests/agent/test_xiaomi_preserve_dots.py (added, +87/-0)

PR #15868: fix: add xiaomi provider to dots-preserve whitelist

Description (problem / solution / changelog)

Summary

Xiaomi/MiMo models use dots in model names (e.g., mimo-v2.5, mimo-v2.5-pro). Without this fix, Hermes converts dots to hyphens (mimo-v2-5), causing API errors:

HTTP 400: Not supported model mimo-v2-5

Changes

  • Added 'xiaomi' to the provider whitelist in _anthropic_preserve_dots()
  • Added 'xiaomimimo.com' to the base_url check

Testing

  • Verified with mimo-v2.5 model on xiaomi provider
  • Model name now preserved as mimo-v2.5 instead of being converted to mimo-v2-5

Fixes #15619

Changed files

  • run_agent.py (modified, +2887/-1597)

Code Example

model:
  default: mimo-v2.5-pro
  provider: xiaomi
  base_url: https://token-plan-cn.xiaomimimo.com/anthropic

---

HTTP 400: Not supported model mimo-v2-5-pro
{'error': {'code': '400', 'message': 'Not supported model mimo-v2-5-pro', 'param': 'Param Incorrect'}}

---

# Line 7243-7248
if (getattr(self, "provider", "") or "").lower() in {
    "alibaba", "minimax", "minimax-cn",
    "opencode-go", "opencode-zen",
    "zai", "bedrock",
}:
    return True

---

# Provider whitelist
if (getattr(self, "provider", "") or "").lower() in {
    "alibaba", "minimax", "minimax-cn",
    "opencode-go", "opencode-zen",
    "zai", "bedrock", "xiaomi",  # Add xiaomi
}:
    return True

# base_url check
return (
    "dashscope" in base
    or "aliyuncs" in base
    or "minimax" in base
    or "opencode.ai/zen/" in base
    or "bigmodel.cn" in base
    or "xiaomimimo.com" in base  # Add xiaomi domain
    or "bedrock-runtime." in base
)
RAW_BUFFERClick to expand / collapse

Bug Description

Xiaomi's MiMo models use dots in model names (e.g., mimo-v2.5-pro), but Hermes automatically converts dots to hyphens for all Anthropic-compatible endpoints, resulting in mimo-v2-5-pro being sent to the API, causing a 400 error.

Steps to Reproduce

  1. Configure Hermes with Xiaomi provider:
model:
  default: mimo-v2.5-pro
  provider: xiaomi
  base_url: https://token-plan-cn.xiaomimimo.com/anthropic
  1. Start a conversation

  2. Observe the error:

HTTP 400: Not supported model mimo-v2-5-pro
{'error': {'code': '400', 'message': 'Not supported model mimo-v2-5-pro', 'param': 'Param Incorrect'}}

Root Cause

In run_agent.py, the _anthropic_preserve_dots() method determines whether to preserve dots in model names. The logic converts dots to hyphens for all providers except those in the whitelist:

# Line 7243-7248
if (getattr(self, "provider", "") or "").lower() in {
    "alibaba", "minimax", "minimax-cn",
    "opencode-go", "opencode-zen",
    "zai", "bedrock",
}:
    return True

Xiaomi is not in this list, so mimo-v2.5-pro becomes mimo-v2-5-pro.

Expected Behavior

Model names with dots should be preserved for Xiaomi/MiMo models, similar to how it works for MiniMax (MiniMax-M2.7), ZAI (glm-4.7, glm-5.1), and other providers.

Suggested Fix

Add Xiaomi to the whitelist in _anthropic_preserve_dots():

  1. Add "xiaomi" to the provider set (line 7246)
  2. Add "xiaomimimo.com" to the base_url checks (line 7256)
# Provider whitelist
if (getattr(self, "provider", "") or "").lower() in {
    "alibaba", "minimax", "minimax-cn",
    "opencode-go", "opencode-zen",
    "zai", "bedrock", "xiaomi",  # Add xiaomi
}:
    return True

# base_url check
return (
    "dashscope" in base
    or "aliyuncs" in base
    or "minimax" in base
    or "opencode.ai/zen/" in base
    or "bigmodel.cn" in base
    or "xiaomimimo.com" in base  # Add xiaomi domain
    or "bedrock-runtime." in base
)

Environment

  • Hermes version: latest (from git)
  • Provider: Xiaomi (xiaomimimo.com)
  • Model: mimo-v2.5-pro

Related Code

  • run_agent.py:7230-7259 - _anthropic_preserve_dots() method
  • agent/anthropic_adapter.py:1009-1032 - normalize_model_name() function

Additional Context

This issue affects all Xiaomi MiMo model versions that use dots in their names. Other providers with similar naming patterns (MiniMax, ZAI/Zhipu) are already whitelisted. Xiaomi should be added for consistency.

extent analysis

TL;DR

Add Xiaomi to the provider whitelist in the _anthropic_preserve_dots() method to preserve dots in model names.

Guidance

  • Verify that the issue is caused by the dot-to-hyphen conversion by checking the API request sent to the Xiaomi endpoint.
  • Update the _anthropic_preserve_dots() method to include "xiaomi" in the provider whitelist.
  • Additionally, update the base_url check to include "xiaomimimo.com" to ensure consistency.
  • Test the changes with a Xiaomi MiMo model that uses dots in its name to confirm the fix.

Example

# Provider whitelist
if (getattr(self, "provider", "") or "").lower() in {
    "alibaba", "minimax", "minimax-cn",
    "opencode-go", "opencode-zen",
    "zai", "bedrock", "xiaomi",  # Add xiaomi
}:
    return True

Notes

This fix assumes that the issue is solely caused by the dot-to-hyphen conversion. If other factors are contributing to the error, additional debugging may be necessary.

Recommendation

Apply the suggested fix by adding Xiaomi to the provider whitelist and updating the base_url check, as this should resolve the issue and ensure consistency with other providers.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING