Skip to content

fix(telegram): prevent block replies when streaming is disabled#1885

Closed
ivancasco wants to merge 1 commit intoopenclaw:mainfrom
ivancasco:fix/block-streaming-disabled-still-emits-blocks
Closed

fix(telegram): prevent block replies when streaming is disabled#1885
ivancasco wants to merge 1 commit intoopenclaw:mainfrom
ivancasco:fix/block-streaming-disabled-still-emits-blocks

Conversation

@ivancasco
Copy link
Copy Markdown
Contributor

Summary

  • Fixes issue where block replies were sent even when disableBlockStreaming=true
  • This caused TTS audio to be sent as a separate message instead of combined with text when draft streaming was active

Problem

When draft streaming is enabled for Telegram, disableBlockStreaming is set to true. However, the onBlockReply handler was still sending blocks via the else branch, causing:

  1. hadBlockReplies=true even though streaming was supposed to be disabled
  2. TTS audio being sent as a separate "audio-only" message instead of combined with the final text

Fix

Added a check for blockStreamingEnabled in the else branch so blocks are only sent when streaming is explicitly enabled.

Test plan

  • Enable draft streaming + TTS auto in Telegram private chat
  • Send a message and verify text appears in draft bubble
  • Verify final message has text + audio combined (not separate)

When `disableBlockStreaming=true` (e.g., when draft streaming is active),
block replies were still being sent via the else branch in the onBlockReply
handler. This caused issues with TTS auto where:

1. Draft streaming would show text incrementally (working correctly)
2. But blocks were still being sent, setting `hadBlockReplies=true`
3. This triggered the "audio-only" TTS path, sending audio separately

The fix adds a check for `blockStreamingEnabled` in the else branch,
so blocks are only sent when streaming is explicitly enabled.
thewilloftheshadow added a commit that referenced this pull request Jan 26, 2026
Co-authored-by: Ivan Casco <ivancasco@users.noreply.github.com>
@thewilloftheshadow
Copy link
Copy Markdown
Member

Squash-merged into main.

  • Squash commit: 84f8f8b
  • Included: skip block replies when streaming is disabled + changelog entry (thanks)
  • Tests: pnpm lint && pnpm build && pnpm test (lint failed in existing src/line/* types)

@thewilloftheshadow
Copy link
Copy Markdown
Member

Closed after squash-merge to main (commit 84f8f8b).

zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
Co-authored-by: Ivan Casco <ivancasco@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants