openclaw - 💡(How to fix) Fix reasoning_content not preserved for non-DeepSeek OpenAI-compatible providers (e.g. Xiaomi MiMo)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

OpenAI-compatible providers that require reasoning_content to be passed back in multi-turn conversations (e.g. Xiaomi MiMo) fail with a 400 error when tool calls are involved. This works for DeepSeek because OpenClaw has dedicated handling (createDeepSeekV4OpenAICompatibleThinkingWrapper + ensureDeepSeekV4AssistantReasoningContent), but other providers with the same API requirement are not covered.

Error Logs

[agent/embedded] embedded run agent end: isError=true model=mimo-v2.5 provider=xiaomi error=LLM request failed: provider rejected the request schema or tool payload. rawError=400 Param Incorrect

Root Cause

In provider-stream-shared-BUAWmRcw.js:

  • ensureDeepSeekV4AssistantReasoningContent adds reasoning_content: "" to assistant messages missing it
  • createDeepSeekV4OpenAICompatibleThinkingWrapper applies this only when shouldPatchModel returns true (DeepSeek V4 models only)

Other providers (Xiaomi, potentially Kimi, etc.) with the same reasoning_content requirement are not covered.

Fix Action

Workaround

Set reasoning: false for the model in openclaw.json to disable thinking mode and avoid the reasoning_content requirement.

Code Example

[model-fallback/decision] model fallback decision: decision=candidate_failed requested=xiaomi/mimo-v2.5 candidate=xiaomi/mimo-v2.5 reason=format next=none detail=400 Param Incorrect
[agent/embedded] embedded run agent end: isError=true model=mimo-v2.5 provider=xiaomi error=LLM request failed: provider rejected the request schema or tool payload. rawError=400 Param Incorrect
RAW_BUFFERClick to expand / collapse

Bug Description

OpenAI-compatible providers that require reasoning_content to be passed back in multi-turn conversations (e.g. Xiaomi MiMo) fail with a 400 error when tool calls are involved. This works for DeepSeek because OpenClaw has dedicated handling (createDeepSeekV4OpenAICompatibleThinkingWrapper + ensureDeepSeekV4AssistantReasoningContent), but other providers with the same API requirement are not covered.

Steps to Reproduce

  1. Configure an OpenAI-compatible provider with a reasoning model (e.g. Xiaomi MiMo mimo-v2.5 with reasoning: true)
  2. Send a message that triggers a tool call
  3. The model returns reasoning_content + tool_calls
  4. OpenClaw sends the tool result back, but does not include the previous reasoning_content in the assistant message
  5. API returns: 400 Param Incorrect — "The reasoning_content in the thinking mode must be passed back to the API."

Expected Behavior

OpenClaw should preserve reasoning_content in assistant messages for all OpenAI-compatible providers that return it, not just DeepSeek.

Error Logs

[model-fallback/decision] model fallback decision: decision=candidate_failed requested=xiaomi/mimo-v2.5 candidate=xiaomi/mimo-v2.5 reason=format next=none detail=400 Param Incorrect
[agent/embedded] embedded run agent end: isError=true model=mimo-v2.5 provider=xiaomi error=LLM request failed: provider rejected the request schema or tool payload. rawError=400 Param Incorrect

Root Cause

In provider-stream-shared-BUAWmRcw.js:

  • ensureDeepSeekV4AssistantReasoningContent adds reasoning_content: "" to assistant messages missing it
  • createDeepSeekV4OpenAICompatibleThinkingWrapper applies this only when shouldPatchModel returns true (DeepSeek V4 models only)

Other providers (Xiaomi, potentially Kimi, etc.) with the same reasoning_content requirement are not covered.

Suggested Fix

Generalize the reasoning_content preservation logic so it applies to any OpenAI-compatible provider/model that returns reasoning_content in its response, rather than gating it behind a DeepSeek-specific model check.

Workaround

Set reasoning: false for the model in openclaw.json to disable thinking mode and avoid the reasoning_content requirement.

Environment

  • OpenClaw version: 2026.5.7
  • Provider: Xiaomi MiMo (token-plan-cn.xiaomimimo.com/v1)
  • Model: mimo-v2.5
  • Platform: macOS

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix reasoning_content not preserved for non-DeepSeek OpenAI-compatible providers (e.g. Xiaomi MiMo)