fix(telegram): send resilience — retry transient tool sends + increase cold-boot budget (#9101, #5770)#10947
Merged
Merged
Conversation
Bump connect retry attempts from 3 to 8 and cap exponential backoff at 15 seconds. Old budget: 3 attempts, 1+2+4=7s total — insufficient for cold boot on slow networks or embedded devices. New budget: 8 attempts, 1+2+4+8+15+15+15=~60s total. Inspired by PR #5770 by @Bartok9 (re-implemented against current main since original was 913 commits stale with conflicts).
This was referenced Apr 16, 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.
Summary
Two complementary Telegram resilience fixes from the community, combined into one PR.
Commit 1: Retry transient tool-send failures (from #9101 by @corazzione)
The gateway adapter already retries transient send failures, but the
send_messagetool's direct_send_telegram()path had zero retry logic. A transient 502/429 killed the send silently._telegram_retry_delay()— classifies exceptions as retryable (502, 429, 503, 504, bad gateway, too many requests) with exponential backoff, respectsretry_afterheader, excludes timeouts_send_telegram_message_with_retry()— up to 3 attempts with asyncio.sleepbot.send_message()calls in_send_telegram()with the retry wrapperFiles:
tools/send_message_tool.py,tests/tools/test_send_message_tool.pyCommit 2: Increase cold-boot retry budget (from #5770 by @Bartok9)
Connect retry attempts bumped from 3 → 8, exponential backoff capped at 15s. Old budget: ~7s total (insufficient for cold boot on slow networks). New: ~60s total.
File:
gateway/platforms/telegram.py(2 lines changed)Test results
Merge via rebase to preserve both contributors' authorship.