fix(matrix): skip reasoning-only messages in reply delivery#24668
Merged
steipete merged 2 commits intoopenclaw:mainfrom Feb 24, 2026
Merged
fix(matrix): skip reasoning-only messages in reply delivery#24668steipete merged 2 commits intoopenclaw:mainfrom
steipete merged 2 commits intoopenclaw:mainfrom
Conversation
When `includeReasoning` is active (or `reasoningLevel` falls back to the model default), the agent emits reasoning blocks as separate reply payloads prefixed with "Reasoning:\n". Matrix has no dedicated reasoning lane, so these internal thinking traces leak into the chat as regular user-visible messages. Filter out pure-reasoning payloads (those starting with "Reasoning:\n" or a `<thinking>` tag) before delivery so internal reasoning never reaches the Matrix room. Fixes openclaw#24411 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Verify that deliverMatrixReplies skips replies whose text starts with "Reasoning:\n" or opens with <thinking>/<think>/<antthinking> tags, while still delivering all normal replies. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
includeReasoningis active (orreasoningLevelfalls back to the model default after being deleted rather than set to"off"), the agent emits reasoning blocks as separate reply payloads prefixed with"Reasoning:\n""Reasoning:\n"or a<thinking>tag) before delivery so internal reasoning never reaches the Matrix roomTest plan
Fixes #24411
🤖 Generated with Claude Code
Greptile Summary
Adds filtering to prevent reasoning-only messages from appearing in Matrix chat rooms. When reasoning is enabled, the agent emits internal thinking traces prefixed with
"Reasoning:\n"or wrapped in<thinking>tags. Since Matrix lacks a dedicated reasoning channel (unlike Telegram), these would leak as user-visible messages. The fix detects and skips pure reasoning payloads before delivery while preserving normal assistant replies.Confidence Score: 5/5
Last reviewed commit: e5dfbdd