-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Bug]: Telegram final replies with media ignore configured mediaMaxMb in outbound delivery path #46023
Copy link
Copy link
Closed
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.bugSomething isn't workingSomething isn't workingbug:crashProcess/app exits unexpectedly or hangsProcess/app exits unexpectedly or hangsclawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.bugSomething isn't workingSomething isn't workingbug:crashProcess/app exits unexpectedly or hangsProcess/app exits unexpectedly or hangsclawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Bug type
Crash (process/app exits or hangs)
Summary
Telegram final replies that include media do not honor the configured mediaMaxMb because the outbound delivery path does not propagate
mediaMaxBytesintodeliverMediaReply(...)/loadWebMedia(...).Steps to reproduce
Expected behavior
Telegram outbound final replies with media should respect the configured
mediaMaxMb/mediaMaxByteslimit and send successfully when the media is within that configured limit.Actual behavior
The final Telegram reply fails during outbound media delivery instead of honoring the configured limit. Investigation of the built output shows that the Telegram outbound path computes
mediaMaxBytes, but the value is not threaded through the final reply delivery chain intodeliverMediaReply(...)and then intoloadWebMedia(...).Relevant evidence from the built distribution:
const mediaMaxBytes = (opts.mediaMaxMb ?? telegramCfg.mediaMaxMb ?? 100) * 1024 * 1024;deliverReplies(...)currently callsdeliverMediaReply(...)without passingmediaMaxBytes, anddeliverMediaReply(...)loads media with:So the configured Telegram media limit exists, but is not consistently applied in the outbound final media reply path.
OpenClaw version
2026.3.11
Operating system
Ubuntu 24
Install method
npm global
Model
codex 5.4
Provider / routing chain
openclaw -> configured provider/router -> Telegram outbound delivery
Config file / key location
channels.telegram.mediaMaxMb
Additional provider/model setup details
This does not appear to be provider-specific. The failure is in the Telegram outbound delivery layer after reply generation, specifically in the final reply path that handles mediaUrl / mediaUrls.
The problematic path is:
The Telegram channel code already computes mediaMaxBytes, but it is not propagated through that outbound media delivery chain.
Logs, screenshots, and evidence
Impact and severity
Affected: Telegram users/channels sending final replies with outbound media
Severity: High (blocks or breaks media replies despite valid configuration)
Frequency: Consistent for the affected code path
Consequence: Final Telegram replies with media may fail unexpectedly, causing missed media responses and requiring local patching
Additional information
This appears to be a narrow parameter-threading bug, not a Telegram API parsing/config bug.
use it in deliverMediaReply(...) when calling loadWebMedia(...), for example:
This would make the Telegram outbound final media reply path consistent with the existing Telegram media limit configuration.