openclaw - 💡(How to fix) Fix Bug: DeepSeek V4 thinking=high produces empty visible content, dispatches blank message to channel

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

DeepSeek V4 API in high thinking mode allocates all output tokens to the reasoning block (reasoning_content), and the content field in the final choice is empty or missing. OpenClaw converts this into a message with content: [{type: "thinking", text: ""}] and dispatches it — but the user-facing channel never displays thinking content, so the user sees a "lost" message.

The model DID complete successfully (1417 output tokens used for reasoning), but the visible answer was never produced.

Fix Action

Fix / Workaround

When DeepSeek V4 Pro (or V4 Flash) runs with thinkingLevel: "high" and the model finishes with stopReason: "stop", the API occasionally returns empty visible text while all output tokens went into the reasoning/thinking block. OpenClaw dispatches this empty message to the channel (Feishu, etc.) without detecting the edge case, resulting in the user seeing nothing on the channel side.

DeepSeek V4 API in high thinking mode allocates all output tokens to the reasoning block (reasoning_content), and the content field in the final choice is empty or missing. OpenClaw converts this into a message with content: [{type: "thinking", text: ""}] and dispatches it — but the user-facing channel never displays thinking content, so the user sees a "lost" message.

Gateway dispatch log

Code Example

{
  "stopReason": "stop",
  "content": [
    {
      "type": "thinking",
      "text": ""
    }
  ]
}

---

21:22:48 [feishu] feishu[main]: dispatch complete (queuedFinal=true, replies=1)

---

{
  "ts": "2026-05-20T13:22:47.405Z",
  "type": "model.completed",
  "data": {
    "aborted": false,
    "timedOut": false,
    "usage": {
      "input": 35524,
      "output": 1417,
      "cacheRead": 1039872,
      "total": 1076813
    },
    "choices": []
  }
}

---

{
  "stopReason": "toolUse",
  "content": [
    {
      "type": "text",
      "text": "我看到了几个线索,让我逐个查一下。"
    },
    {
      "type": "tool_use",
      "name": "...",
      "input": {...}
    }
  ]
}
RAW_BUFFERClick to expand / collapse

Bug description

When DeepSeek V4 Pro (or V4 Flash) runs with thinkingLevel: "high" and the model finishes with stopReason: "stop", the API occasionally returns empty visible text while all output tokens went into the reasoning/thinking block. OpenClaw dispatches this empty message to the channel (Feishu, etc.) without detecting the edge case, resulting in the user seeing nothing on the channel side.

Root cause

DeepSeek V4 API in high thinking mode allocates all output tokens to the reasoning block (reasoning_content), and the content field in the final choice is empty or missing. OpenClaw converts this into a message with content: [{type: "thinking", text: ""}] and dispatches it — but the user-facing channel never displays thinking content, so the user sees a "lost" message.

The model DID complete successfully (1417 output tokens used for reasoning), but the visible answer was never produced.

Evidence

Session metadata

  • OpenClaw version: 2026.5.7 (upgraded to 2026.5.18 in same session)
  • Model: deepseek-art/deepseek-v4-pro
  • thinkingLevel: high
  • Session type: Feishu DM channel

Last assistant message (final turn, stopReason=stop)

{
  "stopReason": "stop",
  "content": [
    {
      "type": "thinking",
      "text": ""
    }
  ]
}

Content count: 1 (only empty thinking block, no text block)

Gateway dispatch log

21:22:48 [feishu] feishu[main]: dispatch complete (queuedFinal=true, replies=1)

The gateway dispatched the empty message to Feishu. The user received nothing visible.

Model API response (from trajectory)

{
  "ts": "2026-05-20T13:22:47.405Z",
  "type": "model.completed",
  "data": {
    "aborted": false,
    "timedOut": false,
    "usage": {
      "input": 35524,
      "output": 1417,
      "cacheRead": 1039872,
      "total": 1076813
    },
    "choices": []
  }
}

Note: choices array is empty, but output: 1417 tokens were consumed — all went to reasoning.

For comparison — previous turn (stopReason=toolUse, thinking works fine, text visible)

{
  "stopReason": "toolUse",
  "content": [
    {
      "type": "text",
      "text": "我看到了几个线索,让我逐个查一下。"
    },
    {
      "type": "tool_use",
      "name": "...",
      "input": {...}
    }
  ]
}

This proves the thinking→text conversion works fine for toolUse turns, only breaks for stop turns.

Proposed fix

When processing a stopReason: "stop" assistant message:

  1. Detect empty visible content: If the message has thinking blocks but zero visible text, do NOT dispatch to the channel.
  2. Auto-retry: Re-submit the conversation turn with a hint like "Please provide your final answer in visible text (not only in thinking)." OR re-submit with thinking disabled for this one turn.
  3. Or fallback behavior: If thinking produced tokens but visible content is empty, try extracting/formatting the thinking content into visible text as a fallback (with a note that thinking was collapsed).

At minimum, the gateway should log a warning when dispatching a message with no visible text content.

Environment

  • OpenClaw: 2026.5.7 → 2026.5.18
  • Provider: deepseek-art via OpenAI-compatible API (https://api.deepseek.com)
  • Model: deepseek-v4-pro (reasoning=true, thinking=high)
  • Channel: Feishu (websocket)
  • OS: Linux x64

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 Bug: DeepSeek V4 thinking=high produces empty visible content, dispatches blank message to channel