Skip to content

fix: defer Telegram streaming overflow chunks - #51266

Closed
RichardAtCT wants to merge 1 commit into
NousResearch:mainfrom
RichardAtCT:fix/telegram-stream-overflow-duplicates
Closed

fix: defer Telegram streaming overflow chunks#51266
RichardAtCT wants to merge 1 commit into
NousResearch:mainfrom
RichardAtCT:fix/telegram-stream-overflow-duplicates

Conversation

@RichardAtCT

Copy link
Copy Markdown

Summary

  • Avoid emitting Telegram overflow continuation messages during in-progress streaming edits
  • Freeze the current preview once it exceeds Telegram's edit limit and let finalization deliver the missing tail once
  • Add regression coverage that mid-stream overflow does not call edit/send continuation APIs

Tests

  • uv run --extra dev python -m pytest tests/gateway/test_telegram_overflow_partial.py -q
  • uv run --extra dev python -m pytest tests/gateway/test_stream_consumer.py tests/gateway/test_stream_consumer_fresh_final.py tests/gateway/test_duplicate_reply_suppression.py tests/gateway/test_telegram_overflow_partial.py -q

@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery platform/telegram Telegram bot adapter P2 Medium — degraded but workaround exists sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages labels Jun 23, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related (Telegram >4096-char streamed-overflow cluster): #50965 (open, flood-control cooldown + RetryAfter parsing), #48648 (open issue, infinite re-split loop), #42766 (closed, partial-overflow recovery). This PR addresses a distinct facet — deferring overflow continuation during in-progress streaming edits and delivering the tail once at finalization — so it is related, not a duplicate. Flagging the cluster for a maintainer to pick the consolidation path.

@teknium1

Copy link
Copy Markdown
Contributor

Closing as superseded by #51736 (merged to main in 73a20a6ad), which fixed #48648 by gating the overflow split on finalize. Your fix targeted gateway/platforms/telegram.py, which no longer exists — the Telegram adapter was relocated to plugins/platforms/telegram/adapter.py in a bundled-plugin refactor, so the change landed there instead. The salvaged PR (#50408 by @Tranquil-Flow) hit the current path. Thanks for the fix and the report — credited in the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/telegram Telegram bot adapter sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants