fix(gateway): keep tool-progress edits alive after Telegram flood control (closes #25188)#28484
Merged
Conversation
…trol When a progress-message edit hits Telegram flood control (RetryAfter), can_edit was unconditionally set to False, permanently disabling coalescing for the rest of the run. Subsequent tool updates were posted as separate new messages instead of updating the existing progress bubble. Fix: only set can_edit=False for non-recoverable edit errors. On flood control, back off by resetting _last_edit_ts so the throttle interval is respected before the next edit attempt. Fixes #25188
Contributor
🔎 Lint report:
|
Contributor
|
Thanks for the clean merge @teknium1 |
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.
Salvage of #25198 (@erhnysr).
Summary
When a tool-progress edit hits Telegram flood control (
RetryAfter),can_editwas unconditionally set toFalse, permanently disabling progress message coalescing for the rest of the run. All subsequent tool updates were posted as separate new messages instead of updating the existing progress bubble.Fix
Only set
can_edit = Falsefor non-recoverable edit errors. On flood control, back off by resetting_last_edit_tsso the existing throttle interval is respected before the next edit attempt. Coalescing resumes automatically after the backoff window.Changes
gateway/run.py::send_progress_messages: scopecan_edit = Falseto non-flood errors.Validation
scripts/run_tests.sh tests/gateway/test_run_progress_topics.py tests/gateway/test_run_progress_interrupt.py -q→ 28/28 passing.Authorship preserved via cherry-pick. AUTHOR_MAP entry added in follow-up commit.