Skip to content

400 error with MiMo models: reasoning_content not preserved in multi-turn tool use #4505

@GodOnlyKn0w

Description

@GodOnlyKn0w

What happened?

Bug Description

When using MiMo models (e.g. mimo-v2.5-pro) via the xiaomi-token-plan provider,
a cold-start session that triggers tool calls (e.g. reading a codebase) immediately
fails with a 400 error on the second turn.

Error Message

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

Root Cause

MiMo's thinking models return reasoning_content in assistant messages (similar to
Anthropic's thinking blocks). This field must be passed back in subsequent turns.
Pi's MiMo/xiaomi provider does not preserve reasoning_content when constructing
conversation history, causing the API to reject the request.

Workaround

Switch to a non-thinking model (mimo-v2-flash, mimo-v2-pro) to avoid the issue.

Environment

  • pi version: 0.74
  • Provider: xiaomi-token-plan
  • Model: mimo-v2.5-pro

Steps to reproduce

  1. Configure xiaomi-token-plan provider with a MiMo thinking model
  2. Start a new session (cold start)
  3. Ask pi to read/explore a codebase
  4. Pi triggers tool calls (read/bash), gets back reasoning_content in the response
  5. Pi builds the next turn's messages without including reasoning_content
  6. MiMo API returns 400

Expected behavior

No response

Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingclosed-because-refactorClosed while the project refactor is in progressinprogressIssue is being worked on

    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