fix(agent): add MiMo to reasoning_content echo-back providers in _needs_thinking_reasoning_pad#24662
Closed
wesleysimplicio wants to merge 1 commit into
Conversation
…ds_thinking_reasoning_pad Multi-turn MiMo (Xiaomi) conversations failed with HTTP 400 "The reasoning_content in the thinking mode must be passed back to the API" because _needs_thinking_reasoning_pad() only covered DeepSeek and Kimi. Add _needs_mimo_tool_reasoning() that matches xiaomimimo.com base URLs or model names containing "mimo", and include it in the predicate. Closes NousResearch#24443 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
This was referenced May 13, 2026
Contributor
Author
|
Closing in favor of #24465 (earliest open) per @alt-glitch's note — same MiMo reasoning_content echo-back fix for #24443. |
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 conversations with Xiaomi MiMo thinking models fail with HTTP 400:
Hermes does not echo
reasoning_contentback on subsequent assistant turns for MiMo, even though the same requirement is already handled for DeepSeek and Kimi.Root cause
_needs_thinking_reasoning_pad()atrun_agent.py:10095only covered two providers:MiMo (
xiaomimimo.com, model names containingmimo) has the identical contract but was absent from this check, so_copy_reasoning_content_for_apinever injected the requiredreasoning_contentplaceholder on assistant turns during history replay.Fix
Add
_needs_mimo_tool_reasoning()detectingxiaomimimo.combase URLs or model names containing"mimo", and include it in_needs_thinking_reasoning_pad():Tests
tests/run_agent/test_mimo_reasoning_content.py(new file):test_mimo_url_triggers_padxiaomimimo.combase URL → both methods returnTruetest_mimo_model_name_triggers_pad"mimo-v2.5-pro"→_needs_mimo_tool_reasoning()returnsTruetest_non_mimo_unaffectedopenai.com+gpt-4o→ both methods returnFalseStash-verify:
FAILED(AttributeError: 'AIAgent' object has no attribute '_needs_mimo_tool_reasoning') before fix,3 passedafter.Visual
graph 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{xiaomimimo.com in base_url?} D --> F{mimo in model name?}Closes #24443