Skip to content

MiMo reasoning models may fail in Hermes because reasoning_content is not preserved in chat history #24443

@mrabit

Description

@mrabit

Bug Description

MiMo reasoning / thinking models can fail in Hermes multi-turn conversations because reasoning_content from prior assistant messages does not appear to be preserved and passed back in subsequent requests.

MiMo's OpenAI-compatible API now requires clients to echo back reasoning_content when continuing a conversation in thinking mode. If Hermes drops that field while rebuilding message history, later requests are rejected.

Actual Behavior

A follow-up request can fail with a 400 error like this:

Error code: 400 - {
  "error": {
    "message": "Param Incorrect",
    "type": "upstream_error",
    "param": "The reasoning_content in the thinking mode must be passed back to the API.",
    "code": "400"
  }
}

This happens during normal conversation continuation rather than necessarily on the first request.

Expected Behavior

If MiMo returns reasoning_content in an assistant message, Hermes should preserve that field in conversation history and include it on the corresponding prior assistant message in later requests.

Why this matters

MiMo treats reasoning_content as required conversation state in thinking mode. If the client does not send it back, the provider returns a non-retryable 400 error.

That makes MiMo reasoning models unreliable in multi-turn Hermes sessions even when the initial request succeeds.

Suspected Root Cause

Hermes likely normalizes assistant messages to standard fields such as:

  • role
  • content
  • tool_calls

but does not preserve MiMo's required assistant field:

  • reasoning_content

As a result, the next request omits required reasoning state.

Suggested Fix

When receiving assistant messages from MiMo's OpenAI-compatible API:

  1. Detect whether the assistant message includes reasoning_content
  2. Store it alongside the assistant message in Hermes conversation history
  3. Include reasoning_content on the corresponding prior assistant message when constructing subsequent requests
  4. Keep this behavior compatible with providers that ignore unknown fields

Example shape:

{
  "role": "assistant",
  "content": "...",
  "reasoning_content": "..."
}

Reference

MiMo documentation describing the requirement:

https://platform.xiaomimimo.com/docs/zh-CN/usage-guide/passing-back-reasoning_content

Additional Notes

Although this surfaced with MiMo, the same compatibility issue may affect other OpenAI-compatible reasoning providers that require reasoning metadata to be echoed back across turns.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/agentCore agent loop, run_agent.py, prompt builderprovider/xiaomiXiaomi MiLMtype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions