openclaw - 💡(How to fix) Fix WhatsApp: Gemini thinking tags (<think>/<final>) still leak after #6328 fix

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…

After the Telegram reasoning tag fix in #6328, the WhatsApp channel still exposes raw <think>...</think> and <final>...</final> tags from Gemini 2.5 Pro to users, even on OpenClaw v2026.5.27.

Root Cause

The fix in #6328 was Telegram-only — it added splitTelegramReasoningText() as a streaming coordinator in the Telegram bot module. The WhatsApp delivery pipeline was not updated equivalently.

Additionally, the @openclaw/whatsapp plugin auto-installs at whatever version is available at install time, and can lag significantly behind the core. Users upgrading the core to v2026.5.27 may still be running @openclaw/[email protected] — a gap of ~3 weeks of fixes.

Fix Action

Fix

Short-term: Ensure @openclaw/whatsapp plugin version is kept in sync with core version: openclaw plugins update @openclaw/whatsapp

Long-term: Apply the same reasoning tag interception to the WhatsApp delivery pipeline as was done for Telegram in #6328. The WhatsApp monitor should use a splitWhatsAppReasoningText() equivalent that:

  • Suppresses pure reasoning-only payloads (via isReasoningReplyPayload() — already present in v2026.5.27)
  • Ensures the text normalization pipeline strips all reasoning tags before sending
RAW_BUFFERClick to expand / collapse

Bug Report

Description

After the Telegram reasoning tag fix in #6328, the WhatsApp channel still exposes raw <think>...</think> and <final>...</final> tags from Gemini 2.5 Pro to users, even on OpenClaw v2026.5.27.

Root Cause

The fix in #6328 was Telegram-only — it added splitTelegramReasoningText() as a streaming coordinator in the Telegram bot module. The WhatsApp delivery pipeline was not updated equivalently.

Additionally, the @openclaw/whatsapp plugin auto-installs at whatever version is available at install time, and can lag significantly behind the core. Users upgrading the core to v2026.5.27 may still be running @openclaw/[email protected] — a gap of ~3 weeks of fixes.

Technical Details

Gemini thinking tag flow:

  1. BUILTIN_REASONING_OUTPUT_MODES = { "google-generative-ai": "tagged" } -> system prompt injects <think>/<final> instructions
  2. Gemini 2.5 Pro ALSO returns native thinking via API (thinkingBudget -> thinkingConfig)
  3. promoteThinkingTagsToBlocks() skips if native thinking blocks already present -> inline tags remain in text blocks
  4. WhatsApp delivery (deliverWebReply) calls normalizeWhatsAppPayloadTextPreservingIndentation -> sanitizeAssistantVisibleTextWithProfile(text, "history") -> stripReasoningTagsFromText(text, { mode: "strict" })

Edge case during streaming: If a <think> block is unclosed and the result is empty, the fallback in stripReasoningTagsFromText returns the thinking content itself — the suspected leak path for streaming/incomplete responses.

Steps to Reproduce

  1. Configure OpenClaw with google/gemini-2.5-pro and reasoning: true, thinkingDefault: "medium"
  2. Pair a WhatsApp account
  3. Send a message that triggers reasoning
  4. Observe <think>...</think><final>...</final> tags appear in the WhatsApp reply

Fix

Short-term: Ensure @openclaw/whatsapp plugin version is kept in sync with core version: openclaw plugins update @openclaw/whatsapp

Long-term: Apply the same reasoning tag interception to the WhatsApp delivery pipeline as was done for Telegram in #6328. The WhatsApp monitor should use a splitWhatsAppReasoningText() equivalent that:

  • Suppresses pure reasoning-only payloads (via isReasoningReplyPayload() — already present in v2026.5.27)
  • Ensures the text normalization pipeline strips all reasoning tags before sending

Environment

  • OpenClaw core: v2026.5.27
  • @openclaw/whatsapp plugin: was v2026.5.7, updated to v2026.5.27 as workaround
  • Model: google/gemini-2.5-pro with reasoning: true
  • Platform: Linux (Debian 12)

Related

  • Follows up on #6328 (Telegram fix; WhatsApp was not covered)
  • User @aflag on #6328 still saw tag leaks after Telegram fix, suggesting other channels affected

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