-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
WhatsApp: Gemini thinking tags (<think>/<final>) still leak after #6328 fix #87712
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Priority
None yet
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/whatsappplugin 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:
BUILTIN_REASONING_OUTPUT_MODES = { "google-generative-ai": "tagged" }-> system prompt injects<think>/<final>instructionsthinkingBudget->thinkingConfig)promoteThinkingTagsToBlocks()skips if nativethinkingblocks already present -> inline tags remain in text blocksdeliverWebReply) callsnormalizeWhatsAppPayloadTextPreservingIndentation->sanitizeAssistantVisibleTextWithProfile(text, "history")->stripReasoningTagsFromText(text, { mode: "strict" })Edge case during streaming: If a
<think>block is unclosed and the result is empty, the fallback instripReasoningTagsFromTextreturns the thinking content itself — the suspected leak path for streaming/incomplete responses.Steps to Reproduce
google/gemini-2.5-proandreasoning: true,thinkingDefault: "medium"<think>...</think><final>...</final>tags appear in the WhatsApp replyFix
Short-term: Ensure
@openclaw/whatsappplugin version is kept in sync with core version:openclaw plugins update @openclaw/whatsappLong-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:isReasoningReplyPayload()— already present in v2026.5.27)Environment
@openclaw/whatsappplugin: was v2026.5.7, updated to v2026.5.27 as workaroundgoogle/gemini-2.5-prowithreasoning: trueRelated