Skip to content

fix(telegram): split long streaming responses and reduce edit throttle#2349

Merged
bug-ops merged 1 commit intomainfrom
2345-telegram-streaming-split
Mar 28, 2026
Merged

fix(telegram): split long streaming responses and reduce edit throttle#2349
bug-ops merged 1 commit intomainfrom
2345-telegram-streaming-split

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 28, 2026

Summary

  • send_or_edit() now splits accumulated text at MAX_MESSAGE_LEN using utf8_chunks() in both the initial-send (None) and edit-overflow (Some) branches, matching the behavior of send(). Fixes Telegram API errors for streaming responses >4096 chars and unblocks the long_output E2E scenario.
  • should_send_update() throttle reduced from 10s to 3s to improve streaming UX when the provider emits chunks at high frequency.
  • long_output E2E item count increased 100→150 to reliably exceed 4096 chars post-MarkdownV2 escaping.

Closes #2345, #2341

Test plan

  • cargo nextest run -p zeph-channels --lib — 3 new tests for send_or_edit() split logic pass
  • Full test suite passes (6985 tests)
  • Telegram E2E: long_output scenario passes with ≥2 messages
  • Telegram E2E: streaming scenario shows edit events with 3s throttle

@github-actions github-actions bot added documentation Improvements or additions to documentation channels zeph-channels crate (Telegram) rust Rust code changes bug Something isn't working size/M Medium PR (51-200 lines) labels Mar 28, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 28, 2026 11:48
@bug-ops bug-ops force-pushed the 2345-telegram-streaming-split branch from 6c2c4b1 to 2d88417 Compare March 28, 2026 11:52
`send_or_edit()` now splits accumulated text at MAX_MESSAGE_LEN using
`utf8_chunks()` in both the initial-send (None) and edit-overflow (Some)
branches, matching the behavior of `send()`. This fixes Telegram API
errors for streaming responses exceeding 4096 chars and unblocks the
long_output E2E scenario (#2345).

Reduce `should_send_update()` throttle from 10s to 3s to improve
streaming UX when the provider emits chunks faster than the old interval
allowed (#2341).

Increase long_output E2E item count from 100 to 150 to reliably exceed
4096 chars post-MarkdownV2 escaping.

Closes #2345, #2341
@bug-ops bug-ops force-pushed the 2345-telegram-streaming-split branch from 2d88417 to 3ef5404 Compare March 28, 2026 11:54
@bug-ops bug-ops merged commit f50d8f5 into main Mar 28, 2026
25 checks passed
@bug-ops bug-ops deleted the 2345-telegram-streaming-split branch March 28, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working channels zeph-channels crate (Telegram) documentation Improvements or additions to documentation rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

1 participant