This repository was archived by the owner on Oct 9, 2026. It is now read-only.
Repository navigation
fix: a Telegram edit refusal is permanent - #29
Merged
Merged
Conversation
EditMessage returned Telegram's refusals unclassified, so the manager kept the placeholder it couldn't edit (it deletes one only after ErrSendFailed) and retried refused progress updates. Edit errors are now classified as send errors: 4xx is ErrSendFailed, 429 a rate limit, 5xx and network failures temporary.
The animator re-edits a progress message every three seconds for up to ten minutes and ignored the edit's error, so a message Telegram refused to edit (now ErrSendFailed) was edited again and again, and a rate limit was ignored. Such an edit now ends the animation; the message stays tracked.
mekjr1
force-pushed
the
fix/telegram-edit-refusal
branch
from
October 7, 2026 17:59
1f2af07 to
10e10ea
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
When a reply should replace the "Thinking…" placeholder, the manager edits the placeholder; if the edit fails, it sends the reply as a new message. It deletes the placeholder first only when the edit was refused (
ErrSendFailed): after another error the edit may have landed. Telegram'sEditMessagereturned every error unclassified, so on Telegram a refused edit left the placeholder in the chat next to the reply.EditMessagenow classifies its errors asSenddoes (classifySendError): a 4xx refusal isErrSendFailed, a 429 a rate limit with Telegram's retry-after, a 5xx or network failureErrTemporary. "Message is not modified" still counts as success, and a dropped connection after the request was sent is still swallowed.The same function updates tool progress messages, whose errors go back to the manager: a refused update is no longer retried three times, and a rate-limited one waits as Telegram asks.
Test:
TestEditMessage_ClassifiesRefusals(fails without the fix).