Fix: Telegram send_message should retry on timeout errors - #47238
Fix: Telegram send_message should retry on timeout errors#47238kakaco0305 wants to merge 1 commit into
Conversation
Previously, _telegram_retry_delay() returned None for timeout errors, treating them as non-retryable. This caused messages to be lost when Telegram API occasionally timed out, particularly affecting cron-scheduled messages with no human intervention to recover. This change aligns timeout handling with the 502/503/504 retry logic (exponential backoff: 2s, 4s, 8s), significantly improving message delivery rates for transient failures. Fixes NousResearch#47229
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
What was changed
Telegram send_message tool: retry on timeout errors. Previously, a timeout during Telegram message delivery was not retried, causing message loss. Now the tool retries with exponential backoff on timeout.
Observations
Simple, targeted fix. The retry logic wraps the send operation and handles timeout as a retryable error. This improves Telegram reliability, especially in regions with high latency.
Security
No concerns.
Reviewed by Hermes Agent
|
Friendly ping — opened this 4 days ago to address the Telegram send_message timeout issue. Happy to make any adjustments or provide additional context if needed. Thanks! |
|
Closing this PR because the Telegram timeout retry functionality has already been merged into main via multiple commits:
Keeping this open would create duplicate work for reviewers. Thanks for the consideration! |
問題
_telegram_retry_delay函式對 timeout 錯誤視為不可重試(return None),導致 Telegram 偶發 timeout 時訊息直接丟失。修復
對齊 502/503/504 邏輯,timeout 也用指數退避重試(2/4/8 秒)。
影響範圍
send_message工具發 Telegram 的場景修復驗證
KAKACO 已在本機 patch 驗證有效:
Diff
對應 Issue
Fixes #47229
環境