WhatsApp: filter reasoning messages from delivery (fixes #25214, #24328)#25804
Closed
Lucenx9 wants to merge 7 commits intoopenclaw:mainfrom
Closed
WhatsApp: filter reasoning messages from delivery (fixes #25214, #24328)#25804Lucenx9 wants to merge 7 commits intoopenclaw:mainfrom
Lucenx9 wants to merge 7 commits intoopenclaw:mainfrom
Conversation
3b5acd4 to
9e23685
Compare
Contributor
|
Reviewed end-to-end and reimplemented on Why not merge as-is:
Landed in
What was implemented:
Verification:
This resolves #25214 and #24328. Thanks for the report and initial patch, @Lucenx9. |
Contributor
|
Implemented and landed on main as commit 039713c with scoped changes/tests; closing this PR in favor of the landed commit. |
This was referenced Feb 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
thinking=low(or any thinking mode) is enabled, the model's reasoning/thinking blocks were being sent to WhatsApp users as visible messages (issues Reasoning/thinking blocks leak into WhatsApp messages #25214, WhatsApp: Internal reasoning exposed as user message #24328).deliverWebReplyto detect and skip messages that start with "Reasoning:" prefix.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
WhatsApp users will no longer see internal reasoning messages when using models with reasoning capabilities.
Security Impact (required)
No)No)No)No)No)Repro + Verification
Environment
Steps
thinking=low)Expected
Actual (before fix)
Reasoning:\n_some internal thinking_Evidence
Added 3 new tests:
All 12 tests pass (9 existing + 3 new).
Human Verification (required)
Compatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
122dba75cRisks and Mitigations
Greptile Summary
This PR filters out reasoning messages from WhatsApp delivery to prevent internal model thinking from being visible to end users.
isReasoningMessage()helper that checks if text starts withReasoning:prefix after trimming whitespacedeliverWebReply()when reasoning message detectedThe fix aligns WhatsApp with other channels (Discord, Matrix, Telegram) that already filter reasoning content. The implementation is simple, focused, and well-tested.
Confidence Score: 5/5
Last reviewed commit: 9e23685
(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!