fix(agent): add MiMo to reasoning_content echo-back providers in _needs_thinking_reasoning_pad#24638
Closed
wesleysimplicio wants to merge 1 commit into
Conversation
…ds_thinking_reasoning_pad
MiMo (Xiaomi, api.xiaomimimo.com) requires reasoning_content to be echoed
back on every assistant tool-call turn, the same contract as DeepSeek and
Kimi. Without it the API rejects subsequent requests with HTTP 400:
The reasoning_content in the thinking mode must be passed back to the API.
Add _needs_mimo_tool_reasoning() and include it in the combined predicate.
Detection: base_url matches xiaomimimo.com OR 'mimo' in model name (covers
MiMo-VL-7B-RL and similar variants).
Closes NousResearch#24443
Collaborator
This was referenced May 13, 2026
Contributor
Author
|
Closing as duplicate/superseded by #24662 to keep one canonical PR per fix topic and avoid review split. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Multi-turn MiMo (Xiaomi) reasoning-model conversations fail with HTTP 400:
Hermes already handles this requirement for DeepSeek and Kimi, but MiMo (
api.xiaomimimo.com, model names containingmimo) was absent from the predicate, so_copy_reasoning_content_for_apinever injected the requiredreasoning_contentplaceholder on replayed assistant turns.Root cause
_needs_thinking_reasoning_pad()at line ~10101 only ORs DeepSeek and Kimi:MiMo was never included.
Fix
Add
_needs_mimo_tool_reasoning()and include it in the combined predicate.flowchart TD A[_needs_thinking_reasoning_pad] --> B[_needs_deepseek_tool_reasoning] A --> C[_needs_kimi_tool_reasoning] A --> D[_needs_mimo_tool_reasoning] D --> E{base_url matches xiaomimimo.com?} E -- yes --> TRUE[return True] D --> F{"'mimo' in model.lower()?"} F -- yes --> TRUE E -- no --> F F -- no --> FALSE[return False]Detection mirrors the DeepSeek/Kimi pattern: match on base URL hostname OR model name substring, covering both direct API access and custom-provider setups.
Tests
New
tests/run_agent/test_mimo_reasoning_content_echo.py— 8 cases:api.xiaomimimo.comdetectedmimo-7b-thinkingmodel name detectedMiMo-VL-7B-RL(mixed-case) detected_needs_thinking_reasoning_pad_needs_thinking_reasoning_padAll 8 pass.
Closes #24443