Files
hermes-agent/tests/plugins/platforms
Teknium ea07a81991 fix(telegram): media uploads wait for Telegram's answer instead of reporting a delivered file as failed
A Bot API server answers sendDocument/sendVideo only after the whole body has
reached Telegram and been processed. The gateway used a fixed 60s read budget
and a 300s wall-clock deadline regardless of size, and the standalone sender
(hermes send, cron, agent send_message) used the Bot's 20s general read
timeout. Large files on slow uplinks or a self-hosted Bot API server, and
small files Telegram takes a while to process, came back "Timed out" and
then landed anyway; a retry duplicated them.

telegram_media_budget.scaled_budgets adds the on-disk payload's transfer time
at 128 KB/s to the read and write timeouts and 1.5x of it to the deadline
(capped at 1h); URLs, file ids and in-memory bytes keep the fixed budgets.
The gateway's _send_media, the album chunk sender and the standalone upload
all use it. A standalone timeout warning now says Telegram may still deliver
the file, and plain `hermes send` prints the result's warnings so the cause
is visible next to the generic "No deliverable" error.

Fixes #133093, fixes #133164, fixes #117795.

Co-authored-by: liuhao1024 <sunsky.lau@gmail.com>
2026-11-10 15:06:13 -08:00
..
…