Skip to content

fix: preserve Xiaomi MiMo thinking blocks - #24893

Closed
hirogen317 wants to merge 2 commits into
NousResearch:mainfrom
hirogen317:fix/24884-xiaomi-mimo-thinking
Closed

fix: preserve Xiaomi MiMo thinking blocks#24893
hirogen317 wants to merge 2 commits into
NousResearch:mainfrom
hirogen317:fix/24884-xiaomi-mimo-thinking

Conversation

@hirogen317

Copy link
Copy Markdown

Summary

  • Add a Xiaomi MiMo Anthropic-compatible endpoint detector for *.xiaomimimo.com/anthropic.
  • Preserve unsigned reasoning_content-derived thinking blocks for Xiaomi MiMo replay turns, matching the existing Kimi/DeepSeek strip-signed/keep-unsigned policy.
  • Add a specification-driven development note plus focused regression coverage for Xiaomi MiMo, signed-block stripping, cache-control stripping, and non-Xiaomi third-party behavior.

Test Plan

  • RED observed before implementation: python -m pytest --tb=short -q tests/agent/test_xiaomi_mimo_anthropic_thinking.py failed with missing detector / thinking blocks stripped.
  • /Users/gen/.hermes/hermes-agent/venv/bin/python -m pytest --tb=short -q tests/agent/test_xiaomi_mimo_anthropic_thinking.py tests/agent/test_deepseek_anthropic_thinking.py → 18 passed.
  • /Users/gen/.hermes/hermes-agent/venv/bin/python -m pytest --tb=short -q tests/agent/test_xiaomi_mimo_anthropic_thinking.py tests/agent/test_deepseek_anthropic_thinking.py tests/agent/test_kimi_coding_anthropic_thinking.py → 35 passed.
  • /Users/gen/.hermes/hermes-agent/venv/bin/python -m ruff check agent/anthropic_adapter.py tests/agent/test_xiaomi_mimo_anthropic_thinking.py → All checks passed.

Docker / containerization

  • No Dockerfile, dependency, or environment-variable changes were needed; the existing container image copies these Python source/test changes normally.
  • Local docker build -t hermes-agent:issue-24884 . was attempted but failed before project build steps while resolving debian:13.4 from Docker Hub due local Docker proxy DNS (lookup http.docker.internal ... connection refused). This appears environment/network-related rather than code-related.

Closes #24884

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint provider/xiaomi Xiaomi MiLM duplicate This issue or pull request already exists labels May 13, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #24465 — 9th+ competing PR for Xiaomi MiMo reasoning_content echo-back. #24465 is the earliest open PR with 26 tests and comprehensive coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have provider/xiaomi Xiaomi MiLM type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add Xiaomi MiMo Anthropic-compatible endpoint support for thinking mode

2 participants