openclaw - 💡(How to fix) Fix [Regression] WebChat: reasoning_content not streamed for Kimi Code & DeepSeek Reasoner — only MiniMax works

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…

Root Cause

Steps to Reproduce

  1. Configure kimi/kimi-for-coding (requires KIMI_API_KEY, anthropic-messages API, https://api.kimi.com/coding/).
  2. Enable thinking (defaultLevel: "low" — currently requires editing node_modules/openclaw/dist/extensions/kimi-coding/index.js because the default is "off").
  3. Open WebChat, send any prompt (e.g., "鸡兔同笼问题").
  4. Observe: no reasoning stream appears, only the final answer after ~14 s.
  5. Repeat with deepseek/deepseek-reasoner — same silent result.
  6. Switch to minimax/MiniMax-M2.7-highspeed — reasoning streams immediately.

Fix Action

Fix / Workaround

Workarounds Tried

  • Thinking default hack: Changed defaultLevel from "off" to "low" in compiled extensions/kimi-coding/index.js and extensions/moonshot/index.js. This enables the upstream request, but the response is still not parsed for reasoning.
  • System-prompt injection: Forcing the model to emit reasoning inside the content field works (visible in UI) but wastes billed tokens and context window. Not a viable production fix.

Code Example

{
    "models.providers.kimi": {
      "baseUrl": "https://api.kimi.com/coding/",
      "api": "anthropic-messages",
      "apiKey": "${KIMI_API_KEY}",
      "models": [{ "id": "kimi-for-coding", "reasoning": true }]
    }
  }

---

{
    "models.providers.deepseek": {
      "baseUrl": "https://api.deepseek.com/v1",
      "api": "openai-completions",
      "models": [{ "id": "deepseek-reasoner", "reasoning": true }]
    }
  }
RAW_BUFFERClick to expand / collapse

Bug Summary

In OpenClaw WebChat, the reasoning/thinking stream from Kimi Code (kimi/kimi-for-coding, Anthropic API) and DeepSeek Reasoner (deepseek/deepseek-reasoner, OpenAI-format reasoning_content) is not rendered at all (or not streamed).
MiniMax (minimax/MiniMax-M2.7-highspeed) works correctly with the same setup.

Desired Behavior

  1. Reasoning should be streamed (character-by-character / chunk-by-chunk) as it arrives from the model.
  2. Reasoning should appear before the final answer — the WebChat UI should show the thinking process first, then transition to the visible reply, matching MiniMax’s behavior.

Actual Behavior

  • Kimi Code: No reasoning UI is shown. Only the final answer appears after a long silent wait. The response definitely contains <thinking> blocks (visible in raw Anthropic stream), but WebChat never extracts or renders them.
  • DeepSeek Reasoner: The reasoning_content field is completely ignored. Only the content (final answer) is displayed, again after a silent delay.
  • MiniMax: Works perfectly — reasoning is mixed into the content stream and is rendered in real time.

Root-Cause Analysis (User-Side Investigation)

  1. Missing resolveReasoningOutputMode hook in the bundled kimi-coding plugin:
    • File: node_modules/openclaw/dist/extensions/kimi-coding/index.js
    • The plugin registers resolveThinkingProfile and wrapStreamFn, but does not define resolveReasoningOutputMode.
    • MiniMax does declare resolveReasoningOutputMode: () => "native", which allows extractThinkingCached() to classify and extract reasoning.
  2. WebChat extractThinkingCached() does not handle reasoning_content field for providers that return it as a separate field (DeepSeek, OpenAI-compatible). It seems to only handle MiniMax’s inline reasoning or explicitly tagged blocks.
  3. Kimi Code Anthropic <thinking> blocks are returned as XML in the content field. The plugin lacks a replay-family hook (e.g., buildHybridAnthropicOrOpenAIReplayPolicy) that would split <thinking> from <text> blocks, unlike MiniMax.

Steps to Reproduce

  1. Configure kimi/kimi-for-coding (requires KIMI_API_KEY, anthropic-messages API, https://api.kimi.com/coding/).
  2. Enable thinking (defaultLevel: "low" — currently requires editing node_modules/openclaw/dist/extensions/kimi-coding/index.js because the default is "off").
  3. Open WebChat, send any prompt (e.g., "鸡兔同笼问题").
  4. Observe: no reasoning stream appears, only the final answer after ~14 s.
  5. Repeat with deepseek/deepseek-reasoner — same silent result.
  6. Switch to minimax/MiniMax-M2.7-highspeed — reasoning streams immediately.

Environment

  • OpenClaw version: 2026.5.27 (27ae826)
  • OS: macOS arm64
  • Node: v25.x
  • Kimi Code config:
    {
      "models.providers.kimi": {
        "baseUrl": "https://api.kimi.com/coding/",
        "api": "anthropic-messages",
        "apiKey": "${KIMI_API_KEY}",
        "models": [{ "id": "kimi-for-coding", "reasoning": true }]
      }
    }
  • DeepSeek config:
    {
      "models.providers.deepseek": {
        "baseUrl": "https://api.deepseek.com/v1",
        "api": "openai-completions",
        "models": [{ "id": "deepseek-reasoner", "reasoning": true }]
      }
    }

Workarounds Tried

  • Thinking default hack: Changed defaultLevel from "off" to "low" in compiled extensions/kimi-coding/index.js and extensions/moonshot/index.js. This enables the upstream request, but the response is still not parsed for reasoning.
  • System-prompt injection: Forcing the model to emit reasoning inside the content field works (visible in UI) but wastes billed tokens and context window. Not a viable production fix.

Related Issues

  • Possibly related to #74021, #86521, #42276 (reasoning-field / reasoning-stream handling).

Suggested Fix

  1. Add resolveReasoningOutputMode: () => "native" (or appropriate mode) to kimi-coding and moonshot provider hooks.
  2. Update WebChat extractThinkingCached() (or equivalent stream pre-processor) to:
    • Parse OpenAI-format reasoning_content field (DeepSeek).
    • Parse Anthropic-format <thinking> XML blocks (Kimi Code).
  3. Ensure the extracted reasoning is emitted as a separate, preceding stream so it renders before the final answer content, matching MiniMax UX.

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 [Regression] WebChat: reasoning_content not streamed for Kimi Code & DeepSeek Reasoner — only MiniMax works