Skip to content

Thinking content leaks into text for MiniMax/Kimi — need per-model thinking control #47913

@semiok

Description

@semiok

Problem

Third-party models (MiniMax M2.5, Moonshot Kimi K2.5) leak their internal thinking/reasoning process into the text content of responses. This is not in a structured thinking or reasoning_content field — it's raw text mixed into the actual reply, making it visible to end users.

Current Behavior

MiniMax M2.5

  • Thinking content appears directly in text, sometimes with <think> tags, sometimes without any tags (plain English reasoning mixed with Chinese reply)
  • No API parameter exists to disable thinking
  • reasoning: true/false in OpenClaw config only controls whether OpenClaw recognizes thinking blocks, not whether the model generates them
  • Gateway's stripThinkingTagsFromText only handles tagged thinking — untagged thinking leaks through

Moonshot Kimi K2.5

  • Similar leaking behavior
  • Does support thinking: { type: "disabled" } API parameter to suppress thinking at the source
  • But OpenClaw has no way to configure this per-model in openclaw.json

What We Tried (and failed)

  1. reasoning: true/false in model config → only controls OpenClaw's parsing, not model behavior
  2. Agent identity field → no effect on thinking
  3. SOUL.md prompt constraints ("don't show thinking") → models ignore this
  4. Manual params.thinking = { type: "disabled" } in openclaw.json → works for Kimi, but no equivalent for MiniMax

Suggested Improvements

1. Per-model thinking control in config

{
  "models": {
    "moonshot/kimi-k2.5": {
      "thinking": { "type": "disabled" }  // passed to API
    },
    "mm/MiniMax-M2.5": {
      "thinking": { "type": "strip" }     // post-process strip
    }
  }
}

2. Robust post-processing strip

Current stripThinkingTagsFromText only handles <think>...</think> tags. Need:

  • Strip <think> tagged blocks (existing)
  • Strip untagged thinking by pattern detection (e.g., lines starting with "Let me think...", "I need to consider...", reasoning chains in English followed by Chinese reply)
  • Configurable per-model: "strip" (aggressive post-process), "disabled" (API param), "allow" (show thinking), "auto" (use API param if available, else strip)

3. Provider-aware thinking parameters

Different providers have different API parameters:

  • Moonshot: thinking: { type: "disabled" }
  • Anthropic: handled natively
  • MiniMax: no API support — must post-process
  • OpenAI-compatible: varies

OpenClaw should map the generic thinking config to the correct provider-specific API parameter.

Impact

Users switching between models get unpredictable UX — some models dump English reasoning chains into group chats. We spent 2 days building workarounds (regex pattern detection, per-model prompt hacks) that should be handled at the framework level.

Environment

  • OpenClaw 2026.3.13
  • Affected models: mm/MiniMax-M2.5, moonshot/kimi-k2.5
  • Not affected: anthropic/claude, xai/grok (handle thinking properly)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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