fix(telegram): filter reasoning segments when reasoningLevel is off#24518
Closed
avirweb wants to merge 1 commit intoopenclaw:mainfrom
Closed
fix(telegram): filter reasoning segments when reasoningLevel is off#24518avirweb wants to merge 1 commit intoopenclaw:mainfrom
avirweb wants to merge 1 commit intoopenclaw:mainfrom
Conversation
When users execute /reasoning off or /think off, reasoning content was still being sent as separate Telegram messages because the splitTextIntoLaneSegments() function extracted reasoning text regardless of the reasoningLevel setting. This change filters out reasoning segments when resolvedReasoningLevel is explicitly set to 'off', ensuring user intent is respected. Fixes: openclaw#9563 (Telegram-specific) Related: 14c54e6 (Discord fix)
2 tasks
Contributor
|
Thanks for the patch direction here. I merged a superseding fix directly on Added regressions in |
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.
Problem
When users execute
/reasoning offor/think offin Telegram, reasoning contentis still sent as separate messages. This happens because
splitTextIntoLaneSegments()extracts reasoning text from model output without checking if reasoning is disabled.
This is the Telegram-specific follow-up to issue #9563, which was previously fixed
for Discord in commit 14c54e6.
Root Cause
The
splitTextIntoLaneSegments()function inbot-message-dispatch.tsalwayscreates reasoning segments when
<think>tags or "Reasoning:" prefixes are foundin the model output. It doesn't respect the user's
reasoningLevelsetting.Solution
Filter out reasoning segments when
resolvedReasoningLevel === "off". TheresolvedReasoningLevelvariable is already available in scope (defined at line 144).Changes
resolvedReasoningLevel !== "off"condition to the reasoning segment check (1 line change)
Testing
/reasoning offRelated Issues
Checklist