Skip to content

fix: pad Xiaomi MiMo reasoning_content replay#24726

Closed
akaDRJ wants to merge 1 commit into
NousResearch:mainfrom
akaDRJ:fix/xiaomi-reasoning-content-pad
Closed

fix: pad Xiaomi MiMo reasoning_content replay#24726
akaDRJ wants to merge 1 commit into
NousResearch:mainfrom
akaDRJ:fix/xiaomi-reasoning-content-pad

Conversation

@akaDRJ

@akaDRJ akaDRJ commented May 13, 2026

Copy link
Copy Markdown

Summary

  • include Xiaomi MiMo in the strict reasoning_content echo-back detection
  • pad replayed Xiaomi/MiMo assistant tool-call turns with a single-space reasoning_content placeholder when needed
  • cover Xiaomi provider aliases and xiaomimimo.com token-plan endpoints in regression tests

Tests

  • /home/jin/.hermes/hermes-agent/venv/bin/python -m pytest tests/run_agent/test_deepseek_reasoning_content_echo.py -q
  • /home/jin/.hermes/hermes-agent/venv/bin/python -m pytest tests/run_agent/test_run_agent.py -k 'kimi_tool_replay_includes_space_reasoning_content or explicit_reasoning_content_beats_normalized_reasoning_on_replay or xiaomi_models_are_treated_as_reasoning_capable' -q
  • git diff --check

@akaDRJ akaDRJ force-pushed the fix/xiaomi-reasoning-content-pad branch from 111dd4c to a650a98 Compare May 13, 2026 02:01
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent loop, run_agent.py, prompt builder provider/xiaomi Xiaomi MiLM labels May 13, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #24465 (earliest open PR for Xiaomi MiMo reasoning_content support, with 26 tests and anthropic_adapter.py coverage). This is the 6th competing PR for #24443 — also competes with #24603, #24605, #24638, #24662.

@akaDRJ

akaDRJ commented May 13, 2026

Copy link
Copy Markdown
Author

Thanks for the duplicate triage. I agree #24465 should be the canonical PR since it is the earliest open fix and already covers the broader Xiaomi MiMo reasoning-content path.

I posted the only extra live datapoint I found on #24465: a gateway fallback request to https://token-plan-cn.xiaomimimo.com/anthropic where prior assistant turns were already Anthropic tool_use content blocks and needed placeholder thinking replay data.

Closing this PR to avoid another competing fix for #24443.

@akaDRJ

akaDRJ commented May 13, 2026

Copy link
Copy Markdown
Author

Closing in favor of #24465.

@akaDRJ akaDRJ closed this May 13, 2026
Peek-A-Booo added a commit to Peek-A-Booo/hermes-agent that referenced this pull request May 13, 2026
… thinking blocks

When strict thinking-replay providers (MiMo, Kimi, DeepSeek) replay
assistant turns that are already in Anthropic content-block format with
tool_use blocks but NO thinking blocks at all, inject a single-space
placeholder thinking block so the upstream API does not reject with
HTTP 400.

This covers akaDRJ's live repro (NousResearch#24726): 29 assistant tool-use turns
in Anthropic content-block form, zero with thinking/reasoning data,
from a provider failover to MiMo's /anthropic endpoint.

Also: address NilsR0711 review feedback:
- Add defence-in-depth '/mimo-' substring check for deep-namespaced models
- Add negative regression tests (MiniMax, Mistral, Phi-4, mimowave, etc.)
- Add deep namespace tests (vendor/sub/mimo-v3)
- Test Anthropic tool_use without thinking (new) + non-MiMo negative guard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder P2 Medium — degraded but workaround exists provider/xiaomi Xiaomi MiLM type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants