Skip to content

fix: add Xiaomi MiMo to thinking-mode reasoning_content echo-back providers#25062

Closed
GMYXDS wants to merge 1 commit into
NousResearch:mainfrom
GMYXDS:fix/add-mimo-thinking-reasoning-pad
Closed

fix: add Xiaomi MiMo to thinking-mode reasoning_content echo-back providers#25062
GMYXDS wants to merge 1 commit into
NousResearch:mainfrom
GMYXDS:fix/add-mimo-thinking-reasoning-pad

Conversation

@GMYXDS

@GMYXDS GMYXDS commented May 13, 2026

Copy link
Copy Markdown

Added a new method to check for Xiaomi MiMo thinking mode and updated the reasoning checks.

What does this PR do?

When Hermes falls back from a non-thinking provider (e.g. Vertex Gemini) to Xiaomi MiMo in thinking mode, all subsequent API calls to MiMo fail with HTTP 400:

"The reasoning_content in the thinking mode must be passed back to the API."

The conversation is permanently broken until /reset.

_needs_thinking_reasoning_pad() only recognizes DeepSeek and Kimi/Moonshot as providers that enforce reasoning_content echo-back. Xiaomi MiMo (mimo-v2.5-pro in thinking mode) has the same requirement but is not listed. This PR adds MiMo detection to fix the issue.

Related Issue

Fixes # (no issue created yet)

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • run_agent.py: Added _needs_mimo_tool_reasoning() method to detect Xiaomi MiMo thinking mode providers (by provider name, model name, and xiaomimimo.com base URL)
  • run_agent.py: Updated _needs_thinking_reasoning_pad() to include _needs_mimo_tool_reasoning() in its check

How to Test

  1. Set primary model to Vertex Gemini, fallback to MiMo (mimo-v2.5-pro via custom provider with xiaomimimo.com base URL)
  2. Send a message that triggers rate-limit on Gemini (HTTP 429)
  3. Hermes falls back to MiMo — subsequent calls should succeed instead of failing with HTTP 400
  4. Verify that conversation history with mixed providers (Gemini + MiMo) replays correctly to MiMo

Reproduction (before fix)

  1. Configure fallback chain: primary = Vertex Gemini, fallback = MiMo (mimo-v2.5-pro)
  2. Trigger Gemini rate-limit (429)
  3. Hermes falls back to MiMo
  4. Next call fails with: HTTP 400: "The reasoning_content in the thinking mode must be passed back to the API."
  5. Conversation is permanently broken until /reset

After fix

Same steps as above — step 4 succeeds, conversation continues normally.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Linux (GCP Ubuntu)

Added a new method to check for Xiaomi MiMo thinking mode and updated the reasoning checks.
@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent loop, run_agent.py, prompt builder provider/xiaomi Xiaomi MiLM duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists labels May 13, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #24465 — this is the 9th+ competing PR for Xiaomi MiMo reasoning_content echo-back support. #24465 was the earliest open PR with 26 tests and is the canonical implementation. Also overlaps with #24603, #24784, #24810, #24832.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the Xiaomi MiMo reasoning_content fix. An automated hermes-sweeper review found this is already implemented on current main via an equivalent salvaged fix, so this duplicate PR can be closed.

Evidence:

  • run_agent.py:4828 wires self._needs_mimo_tool_reasoning() into _needs_thinking_reasoning_pad() alongside DeepSeek and Kimi/Moonshot.
  • run_agent.py:4871 defines _needs_mimo_tool_reasoning() with the requested Xiaomi MiMo detection by provider, model name, and xiaomimimo.com base URL.
  • agent/conversation_loop.py:862 re-applies the reasoning echo-back pad after retry/fallback provider switches, including MiMo require-side fallback.
  • Commit efa97af7e25f0cbef92ed15bbcb47e4788c83058 (fix(agent): add Xiaomi MiMo to reasoning_content echo-back providers) added the implementation and is contained in v2026.5.16.

@teknium1 teknium1 closed this Jun 12, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jun 12, 2026
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 duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists provider/xiaomi Xiaomi MiLM sweeper:implemented-on-main Sweeper: behavior already present on current main type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants