fix(telegram): recover final delivery after stream flood - #62253
Closed
helix4u wants to merge 1 commit into
Closed
Conversation
helix4u
marked this pull request as ready for review
July 10, 2026 18:56
Collaborator
Related: this consolidates the two Telegram final-delivery cases split across #55869 / #59864 / #54331, and overlaps the flood-control final-delivery family (#53865, #52933, #40162). It is a different/consolidating mechanism (immediate turn-final fallback + tail-vs-fresh-final decision in |
13 tasks
This was referenced Jul 17, 2026
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.
What does this PR do?
Fixes a Telegram streaming failure where Hermes completes the final response, a turn-final edit hits flood control, and the gateway later suppresses its normal final send because streaming delivery was recorded as complete. Users can be left with only a short preview such as :( or a partial answer.
This consolidates the two final-delivery cases that are split across existing proposals:
The change is Telegram-specific through adapter capability flags. Other platforms retain the existing adaptive edit retry behavior.
It also avoids another cosmetic cursor edit after the turn-final edit is already flood-controlled, honors Telegram retry_after during fallback sends, and preserves duplicate suppression for ambiguous timeout results.
Related Issue
Related PRs: #55869, #59864, #54331
Support report: https://discord.com/channels/1053877538025386074/1524313834641297489
Type of Change
Changes Made
How to Test
Local focused verification:
The repository pytest suite was not run locally because this operator environment has a known host deadlock risk in its test setup. Full pytest coverage is left to GitHub CI.
Checklist
Code
Documentation & Housekeeping
Screenshots / Logs
Sanitized support evidence from Hermes 0.18.2 [9cb2a8a] on macOS with Telegram:
The model/provider completed the response. The failure boundary is final Telegram delivery after streamed edit flood control.