fix: preserve thinking blocks for Xiaomi MiMo models via Anthropic relay - #26775
Closed
CallMe1101 wants to merge 1 commit into
Closed
fix: preserve thinking blocks for Xiaomi MiMo models via Anthropic relay#26775CallMe1101 wants to merge 1 commit into
CallMe1101 wants to merge 1 commit into
Conversation
MiMo reasoning models (mimo-v2.5-pro, etc.) require reasoning_content
(thinking blocks) to round-trip on subsequent API calls, same contract
as Kimi and DeepSeek thinking models. Without this, multi-turn tool-use
conversations through Anthropic-compatible relays fail with HTTP 400:
The reasoning_content in the thinking mode must be passed back
to the API.
Add _model_name_is_mimo_family() detection (prefixes: mimo-, mimo_)
following the established Kimi (NousResearch#13848) and DeepSeek (NousResearch#16748) pattern,
and include it in _preserve_unsigned_thinking.
Fixes NousResearch#26774
Author
|
sry,wait |
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.
What
Preserve unsigned thinking blocks for Xiaomi MiMo reasoning models when accessed through Anthropic-compatible relays.
Why
MiMo models (e.g.
mimo-v2.5-pro) use an extended-thinking mode that returnsreasoning_contentwhich must be passed back on subsequent API calls — the same contract as Kimi (#13848) and DeepSeek (#16748). Without this, multi-turn tool-use conversations through Anthropic-compatible relays fail with HTTP 400:Currently, Hermes strips ALL thinking blocks for generic third-party Anthropic endpoints, only preserving them for Kimi and DeepSeek specifically. MiMo models accessed through relays fall into the generic third-party path and hit this error.
How
_MIMO_FAMILY_MODEL_PREFIXES(prefixes:mimo-,mimo_) — same pattern as_KIMI_FAMILY_MODEL_PREFIXES_model_name_is_mimo_family()detection function_preserve_unsigned_thinkingto include MiMo detectionTesting
mimo-v2.5-pro→ True,kimi-k2.5→ False,claude-sonnet-4→ FalseFixes #26774