fix(telegram): keep MarkdownV2 on flood finalize edits - #69642
Open
rsk-731 wants to merge 1 commit into
Open
Conversation
Flood control / RetryAfter was treated like a MarkdownV2 parse failure during finalize edits, so the adapter stripped formatting and fell back to plain text. Users then saw unrendered final replies after rate limits. Re-raise flood errors into the existing wait/retry path, retry short floods still as MarkdownV2, and reserve plain fallback for real parse failures only.
Collaborator
Contributor
|
Thanks for isolating the normal finalized-edit failure: current main still catches every MarkdownV2 edit error and strips formatting ( Problems
Suggested changes
Automated hermes-sweeper review. |
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.
Summary
RetryAfterlike a MarkdownV2 parse failure and fell back to plain text.tests/gateway/test_telegram_format.py.Root cause
In
TelegramAdapter.edit_message(finalize=True), the MarkdownV2edit_message_textexcept-block stripped formatting on any error, including:Flood control exceeded. Retry in N secondsTest plan
pytest tests/gateway/test_telegram_format.py::TestEditMessageStreamingSafety -qpytest tests/gateway/test_telegram_final_delivery.py::test_telegram_long_flood_result_keeps_retry_after -qNotes
Operational mitigation still useful on busy bots: keep Telegram
tool_progress/ streaming quiet to avoid flooding the Bot API.