fix(telegram): stop block streaming from splitting messages when streamMode is off#17704
Merged
obviyus merged 2 commits intoopenclaw:mainfrom Feb 16, 2026
Merged
Conversation
346bfbc to
e609e0e
Compare
e609e0e to
847162c
Compare
Contributor
|
Merged via squash. Thanks @saivarunk! |
Contributor
Author
|
Thanks @obviyus |
Open
6 tasks
jun-planfit
pushed a commit
to planfit/openclaw
that referenced
this pull request
Feb 19, 2026
…amMode is off (openclaw#17704) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 847162c Co-authored-by: saivarunk <[email protected]> Co-authored-by: obviyus <[email protected]> Reviewed-by: @obviyus
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.
fix(telegram): stop block streaming from splitting messages when streamMode is off
Summary
streamMode: "off"is set for Telegram,disableBlockStreamingwas left asundefined, allowingblockStreamingDefault: "on"to keep block streaming active. Each LLM text content block then became a separate Telegram message, splittingmessages on newlines.
streamMode === "off"to the condition that setsdisableBlockStreaming = true, so block streaming is disabled when stream mode is off.streamModeis"partial"or"block", or whenblockStreamingis explicitly set totrue/falsein account config.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Telegram replies are no longer split into multiple messages when
streamMode: "off"is configured. Messages with newlines are now delivered as a single message.Security Impact (required)
NoNoNoNoNoRepro + Verification
Environment
streamMode: "off", defaultblockStreamingDefaultSteps
streamMode: "off"Expected
Actual
Evidence
All 5 tests pass in
bot-message-dispatch.test.ts, including the new test"disables block streaming when streamMode is off".Human Verification (required)
streamMode: "off"now setsdisableBlockStreaming: true; existing tests for draft streaming and explicitblockStreaming: trueconfig still pass.blockStreamingexplicitly set totruestill overrides;streamMode: "partial"behavior unchanged.Compatibility / Migration
YesNoNoFailure Recovery (if this breaks)
bot-message-dispatch.tsline 172, or setblockStreaming: truein account config.src/telegram/bot-message-dispatch.tsstreamMode: "off".Risks and Mitigations
None — the change only adds an additional condition to an existing ternary, scoped to
streamMode === "off".Test plan
pnpm buildpassespnpm testpasses (5/5 inbot-message-dispatch.test.ts)streamMode: "off"→disableBlockStreaming: trueAI-assisted (Claude). Tested with automation. I understand what the code does.
Greptile Summary
Fixes a bug where Telegram replies were split into multiple messages when
streamMode: "off"was configured. Previously, whenstreamModewas"off",draftStreamwasundefined, causingdisableBlockStreamingto also beundefined. This allowed theblockStreamingDefault: "on"agent config to re-enable block streaming inget-reply-directives.ts, which sent each LLM text content block as a separate Telegram message.streamMode === "off"to the condition computingdisableBlockStreaminginbot-message-dispatch.ts, so it evaluates totruewhen streaming is offstreamMode: "off"correctly setsdisableBlockStreaming: trueand skips draft stream creationdispatchWithContextto accept an optionalstreamModeparameter (defaults to"partial"for backward compatibility)streamMode: "partial"or"block", or whenblockStreamingis explicitly configuredConfidence Score: 5/5
|| streamMode === "off") to an existing ternary expression. The logic is correct: operator precedence is right, the fix precisely addresses the described bug, and it doesn't affect other stream modes or explicit blockStreaming config. The new test covers the exact scenario, and the test helper changes maintain backward compatibility. I verified the downstream consumer (get-reply-directives.ts) to confirm thatdisableBlockStreaming: truecorrectly resolves block streaming to "off".Last reviewed commit: db76553
(2/5) Greptile learns from your feedback when you react with thumbs up/down!