Skip to content

Telegram mediaMaxMb config doesn't inherit from agents.defaults #6453

@Klowalski

Description

@Klowalski

Summary

When receiving files via Telegram that exceed the default 5MB media limit, the error message is unclear and the config hierarchy is confusing. Setting agents.defaults.mediaMaxMb does not affect Telegram's media handling — you must also set channels.telegram.mediaMaxMb separately.

Steps to Reproduce

  1. Configure OpenClaw with Telegram channel (default config, no mediaMaxMb set)
  2. Send a file >5MB via Telegram (e.g., a 10MB zip split)
  3. Observe error in logs: media group handler failed: Error: Media exceeds 5MB limit
  4. Set agents.defaults.mediaMaxMb: 20 via config.patch
  5. Restart gateway
  6. Send the same file again
  7. Still fails with the same 5MB error
  8. Must also set channels.telegram.mediaMaxMb: 20 to actually fix it

Expected Behavior

Either:

  1. agents.defaults.mediaMaxMb should be inherited by channel configs (with channel-specific override capability), OR
  2. The error message should specify which config key needs to be changed

Actual Behavior

  • agents.defaults.mediaMaxMb does not cascade to Telegram channel
  • Error message doesn't indicate which config to change
  • User must discover channels.telegram.mediaMaxMb exists separately

Suggested Fix

Option A (preferred): Make channel configs inherit from agents.defaults.mediaMaxMb as a fallback, so users only need to set it once.

Option B: Improve the error message to include the relevant config path:

Media exceeds 5MB limit. Increase channels.telegram.mediaMaxMb in config.

Environment

  • OpenClaw version: 2026.1.29
  • Channel: Telegram (webhook mode)
  • OS: Ubuntu (arm64)

Logs

{"subsystem":"gateway/channels/telegram","1":"media group handler failed: Error: Media exceeds 5MB limit",...}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions