Skip to content

fix: preserve Xiaomi MiMo reasoning_content on anthropic adapter replay#24747

Open
daxigua1hao wants to merge 1 commit into
NousResearch:mainfrom
daxigua1hao:fix/xiaomi-mimo-reasoning-content-replay
Open

fix: preserve Xiaomi MiMo reasoning_content on anthropic adapter replay#24747
daxigua1hao wants to merge 1 commit into
NousResearch:mainfrom
daxigua1hao:fix/xiaomi-mimo-reasoning-content-replay

Conversation

@daxigua1hao

@daxigua1hao daxigua1hao commented May 13, 2026

Copy link
Copy Markdown

MiMo's /anthropic endpoint enforces the same strict thinking-history contract as Kimi and DeepSeek: assistant tool-call turns must carry reasoning_content back or the API returns HTTP 400.

  • Add _is_xiaomi_mimo_endpoint() to anthropic_adapter.py
  • Include MiMo in _preserve_unsigned_thinking condition
  • Add _needs_xiaomi_tool_reasoning() to run_agent.py
  • Add regression test for MiMo thinking replay

What does this PR do?

Related Issue

Fixes #

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

How to Test

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:

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

For New Skills

  • This skill is broadly useful to most users (if bundled) — see Contributing Guide
  • SKILL.md follows the standard format (frontmatter, trigger conditions, steps, pitfalls)
  • No external dependencies that aren't already available (prefer stdlib, curl, existing Hermes tools)
  • I've tested the skill end-to-end: hermes --toolsets skills -q "Use the X skill to do Y"

Screenshots / Logs

MiMo's /anthropic endpoint enforces the same strict thinking-history
contract as Kimi and DeepSeek: assistant tool-call turns must carry
reasoning_content back or the API returns HTTP 400.

- Add _is_xiaomi_mimo_endpoint() to anthropic_adapter.py
- Include MiMo in _preserve_unsigned_thinking condition
- Add _needs_xiaomi_tool_reasoning() to run_agent.py
- Add regression test for MiMo thinking replay
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have 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 replay support). Also competes with #24603, #24605, #24726.

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 P3 Low — cosmetic, nice to have 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