Skip to content

fix: suppress reasoning payloads from generic channel dispatch path (WhatsApp/web leak)#24991

Merged
steipete merged 7 commits intoopenclaw:mainfrom
stakeswky:fix/reasoning-leak-channel-dispatch
Feb 24, 2026
Merged

fix: suppress reasoning payloads from generic channel dispatch path (WhatsApp/web leak)#24991
steipete merged 7 commits intoopenclaw:mainfrom
stakeswky:fix/reasoning-leak-channel-dispatch

Conversation

@stakeswky
Copy link

@stakeswky stakeswky commented Feb 24, 2026

Problem

When reasoningLevel is "on" (either explicitly via /reasoning on or auto-enabled), reasoning/thinking content was being sent as a visible message to WhatsApp and other non-Telegram channels.

Two paths caused the leak:

  1. Block reply path: handleMessageEnd emits reasoning via onBlockReply when includeReasoning is true
  2. Final payload path: buildEmbeddedRunPayloads adds reasoning text to replyItems when reasoningLevel === "on"

Telegram has its own dispatch path (bot-message-dispatch.ts) that splits reasoning into a dedicated lane and handles suppression via splitTelegramReasoningText. The generic dispatch-from-config.ts path used by WhatsApp, web, and other channels had no such filtering.

Fix

  • Add isReasoning?: boolean flag to ReplyPayload
  • Tag reasoning payloads at both emission points (handlers.messages.ts and payloads.ts)
  • Filter isReasoning payloads in dispatch-from-config.ts for both block reply and final reply paths

Telegram is unaffected: it uses its own deliver callback that detects reasoning via the Reasoning:\n prefix and routes to a separate lane.

Tests

  • 2 new tests in dispatch-from-config.test.ts covering both suppression paths
  • All existing tests pass (739 auto-reply tests, 46 Telegram dispatch tests)

Fixes #24954

Greptile Summary

Fixed reasoning/thinking content leak to WhatsApp, web, and other non-Telegram channels by adding an isReasoning flag to ReplyPayload and filtering these payloads in the generic dispatch path (dispatch-from-config.ts).

The fix addresses two leak paths:

  • Block reply emissions from handleMessageEnd when includeReasoning is true
  • Final payload emissions from buildEmbeddedRunPayloads when reasoningLevel === "on"

Telegram is unaffected since it uses a dedicated dispatch path (bot-message-dispatch.ts) with splitTelegramReasoningText that routes reasoning to a separate lane. This change only affects the generic dispatch path used by WhatsApp, web, and extension channels (msteams, feishu, matrix, mattermost, bluebubbles).

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The fix is surgical and well-tested, with clear filtering logic at both emission points. The isReasoning flag is properly tagged where reasoning payloads are created, and both the block reply and final reply paths in the generic dispatcher correctly filter these payloads. Telegram's existing reasoning handling is preserved through its separate dispatch path. The two new tests cover both suppression scenarios comprehensively.
  • No files require special attention

Last reviewed commit: a65e7a9

@openclaw-barnacle openclaw-barnacle bot added agents Agent runtime and tooling size: S labels Feb 24, 2026
@steipete steipete force-pushed the fix/reasoning-leak-channel-dispatch branch from a65e7a9 to 1b22a99 Compare February 24, 2026 04:01
steipete added a commit to stakeswky/openclaw that referenced this pull request Feb 24, 2026
steipete added a commit to stakeswky/openclaw that referenced this pull request Feb 24, 2026
@openclaw-barnacle openclaw-barnacle bot added the app: macos App: macos label Feb 24, 2026
steipete added a commit to stakeswky/openclaw that referenced this pull request Feb 24, 2026
@steipete steipete force-pushed the fix/reasoning-leak-channel-dispatch branch from 52767c5 to 969b68a Compare February 24, 2026 04:09
steipete added a commit to stakeswky/openclaw that referenced this pull request Feb 24, 2026
steipete added a commit to stakeswky/openclaw that referenced this pull request Feb 24, 2026
steipete added a commit to stakeswky/openclaw that referenced this pull request Feb 24, 2026
steipete added a commit to stakeswky/openclaw that referenced this pull request Feb 24, 2026
steipete added a commit to stakeswky/openclaw that referenced this pull request Feb 24, 2026
@openclaw-barnacle openclaw-barnacle bot added channel: discord Channel integration: discord channel: telegram Channel integration: telegram commands Command implementations labels Feb 24, 2026
User and others added 6 commits February 24, 2026 04:20
When reasoningLevel is 'on', reasoning content was being sent as a
visible message to WhatsApp and other non-Telegram channels via two
paths:
1. Block reply: emitted via onBlockReply in handleMessageEnd
2. Final payloads: added to replyItems in buildEmbeddedRunPayloads

Telegram has its own dispatch path (bot-message-dispatch.ts) that
splits reasoning into a dedicated lane and handles suppression.
The generic dispatch-from-config.ts path used by WhatsApp, web, etc.
had no such filtering.

Fix:
- Add isReasoning?: boolean flag to ReplyPayload
- Tag reasoning payloads at both emission points
- Filter isReasoning payloads in dispatch-from-config.ts for both
  block reply and final reply paths

Telegram is unaffected: it uses its own deliver callback that detects
reasoning via the 'Reasoning:\n' prefix and routes to a separate lane.

Fixes openclaw#24954
@steipete steipete force-pushed the fix/reasoning-leak-channel-dispatch branch from 54c342f to 2aa85fc Compare February 24, 2026 04:21
@openclaw-barnacle openclaw-barnacle bot removed channel: discord Channel integration: discord channel: telegram Channel integration: telegram commands Command implementations labels Feb 24, 2026
@steipete steipete merged commit 5ac70b3 into openclaw:main Feb 24, 2026
12 of 13 checks passed
Prithvirajbilla pushed a commit to Prithvirajbilla/openclaw that referenced this pull request Feb 24, 2026
Prithvirajbilla pushed a commit to Prithvirajbilla/openclaw that referenced this pull request Feb 24, 2026
Prithvirajbilla pushed a commit to Prithvirajbilla/openclaw that referenced this pull request Feb 24, 2026
Prithvirajbilla pushed a commit to Prithvirajbilla/openclaw that referenced this pull request Feb 24, 2026
Prithvirajbilla pushed a commit to Prithvirajbilla/openclaw that referenced this pull request Feb 24, 2026
plgs2005 pushed a commit to plgs2005/openclaw that referenced this pull request Feb 24, 2026
plgs2005 pushed a commit to plgs2005/openclaw that referenced this pull request Feb 24, 2026
plgs2005 pushed a commit to plgs2005/openclaw that referenced this pull request Feb 24, 2026
plgs2005 pushed a commit to plgs2005/openclaw that referenced this pull request Feb 24, 2026
plgs2005 pushed a commit to plgs2005/openclaw that referenced this pull request Feb 24, 2026
plgs2005 pushed a commit to plgs2005/openclaw that referenced this pull request Feb 24, 2026
margulans pushed a commit to margulans/Neiron-AI-assistant that referenced this pull request Feb 25, 2026
margulans pushed a commit to margulans/Neiron-AI-assistant that referenced this pull request Feb 25, 2026
margulans pushed a commit to margulans/Neiron-AI-assistant that referenced this pull request Feb 25, 2026
margulans pushed a commit to margulans/Neiron-AI-assistant that referenced this pull request Feb 25, 2026
margulans pushed a commit to margulans/Neiron-AI-assistant that referenced this pull request Feb 25, 2026
margulans pushed a commit to margulans/Neiron-AI-assistant that referenced this pull request Feb 25, 2026
brianleach pushed a commit to brianleach/openclaw that referenced this pull request Feb 26, 2026
brianleach pushed a commit to brianleach/openclaw that referenced this pull request Feb 26, 2026
brianleach pushed a commit to brianleach/openclaw that referenced this pull request Feb 26, 2026
brianleach pushed a commit to brianleach/openclaw that referenced this pull request Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: macos App: macos size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Reasoning/thinking content leaks to WhatsApp channel

2 participants