fix(telegram): honor outbound media max bytes#83478
Conversation
|
Codex review: needs maintainer review before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. Current main documents the outbound cap and computes PR rating What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land this focused parameter-threading fix after normal CI and branch freshness gates, preserving both Do we have a high-confidence way to reproduce the issue? Yes. Current main documents the outbound cap and computes Is this the best way to solve the issue? Yes. The PR reuses the existing config and Label changes:
Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 110042d840bb. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
ClawSweeper PR egg ✨ Hatched: 🌱 uncommon Sunspot Review Wisp Hatch commandComment Hatchability rules:
Rarity: 🌱 uncommon. What is this egg doing here?
|

Telegram final replies with media above the default cap can fail even when users configured a larger
channels.telegram.mediaMaxMblimit.Fixes #46023
Affected surface
extensions/telegram/src/bot-core.tsextensions/telegram/src/bot-message-dispatch.tsextensions/telegram/src/bot-native-commands.tsextensions/telegram/src/bot/delivery.replies.tsScope
This is a narrow parameter-threading fix. It carries the existing Telegram media byte cap into final and native reply delivery, then reuses
buildOutboundMediaLoadOptions({ maxBytes })when outbound media is loaded. No new config, policy, or media-limit strategy is introduced.Approximate scope: 52 inserted lines / 4 removed lines including regression tests.
Real behavior proof
Behavior or issue addressed: Telegram final/native replies with media now thread the configured 50 MiB
mediaMaxMbcap into outbound media loading instead of falling back to the default video cap.Real environment tested: Local Linux executor, branch
wolf/telegram-outbound-media-maxbytes, head935da229b9, Node.jsv22.22.2; real Telegram Bot API delivery throughsendVideointo Telegram Desktop.Exact steps or command run after this patch:
deliverRepliesfromextensions/telegram/src/bot/delivery.replies.ts.deliverReplies->deliverMediaReply->loadWebMedia-> Telegram Bot APIsendVideo.mediaMaxBytes.mediaMaxBytes = 52428800.Evidence after fix (screenshot, recording, terminal capture, console output, redacted runtime log, linked artifact, or copied live output): Telegram Desktop visible proof is attached at https://github.com/user-attachments/assets/ed6790f0-d4b3-431d-b333-a2bc43d9e06c and also referenced from fix(telegram): honor outbound media max bytes #83478 (comment).
Redacted local live run log:
Observed result after fix: Without
mediaMaxBytes, the same 35,462,055-byte MP4 fails in OpenClaw media loading with the default 16 MiB video cap. WithmediaMaxBytes = 52428800,loadWebMediaaccepts the media, Telegram Bot APIsendVideoreturns HTTP 200, and Telegram Desktop shows the delivered media.What was not tested: This live proof covers the Telegram video reply path on a local Linux executor with real Telegram Bot API delivery; macOS/iOS apps and non-Telegram channels are outside this PR.
Before evidence (optional but encouraged): The before case in the same live harness failed before Telegram delivery with
Media exceeds 16MB limit (got 33.82MB).Local regression/changed-check output:
Coverage note
ClawSweeper confirmed in issue #46023 that current main still has this gap: Telegram computes
mediaMaxBytes, but normal final replies and native-command replies do not thread a media cap intodeliverReplies,deliverMediaReply, orloadWebMedia. I also checked open PR coverage before starting; no open PR covered #46023,Telegram mediaMaxMb, ordeliverReplies mediaMaxBytes.