Skip to content

[Bug]: [Bug] Telegram integration fails to send local media (Returns "Media failed") via <final>MEDIA:... #74061

@averyavi

Description

@averyavi

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

After updating to the April 26 release, the Telegram integration fails to deliver local media files. When the agent outputs a valid local file path using the <final>MEDIA:... tag, the file is not transmitted. Instead, the Telegram chat simply displays a Media failed message.

This appears to be a regression, as the exact same workflow and file paths functioned correctly in earlier April builds. The system correctly generates and saves the file to the disk, but the outbound delivery pipeline to Telegram API seems to drop the payload.

Environment:

  • OpenClaw Version: April 26 Release (e.g., v2026.4.26)
  • OS: Linux
  • Integration: Telegram Bot API
  • Agent Context: Local workspace execution

Steps to reproduce

  1. Configure OpenClaw with an active Telegram bot integration.
  2. Execute an agent workflow that generates or accesses a local media file (e.g., a screenshot).
  3. The agent attempts to deliver the file to Telegram using the standard output format:
    <final>MEDIA:/home/openclaw/.openclaw/workspace/myscreen-agent/src/screenshot.png</final>
    
  4. Check the Telegram chat.

Expected behavior

The agent should successfully parse the local file path, attach the image payload, and deliver it to the Telegram chat for viewing.

Actual behavior

The file is not sent. The Telegram chat only receives a fallback error message: ⚠️ Media failed.

OpenClaw version

v2026.4.26

Operating system

Ubuntu 24.04 Desktop

Install method

npm install -g openclaw@latest

Model

google/gemma4:31b-it,ollama/gemma4:31b-cloud

Provider / routing chain

Entry Point: OpenClaw internal output parser->Gateway/Proxy: Nginx (configured as reverse proxy for Open WebUI)->Issue observed at: Outbound Delivery stage->Protocol failure: Failed to resolve or stream local filesystem path /home/openclaw/... into the Telegram API multipart/form-data request body.

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

Affected telegram
Severity blocks workflow
Frequency always
Consequence missed .png .pptx ................

Additional information

File Existence: Manually verified that /home/openclaw/.openclaw/workspace/myscreen-agent/src/screenshot.png exists on the disk at the exact moment the agent attempts to send it.
Permissions: Verified that the openclaw user has the necessary read permissions for the target directory and the file itself.
Alternative Files: Attempted to send different file types and files from different local directories, resulting in the same Media failed error.
Workaround: Sending remote URLs (e.g., http://...) works perfectly; the failure is strictly isolated to parsing and uploading local file paths.

It appears the Outbound Delivery process might be failing to correctly encode local file streams into the multipart/form-data required by the Telegram API, or there is an issue with directory whitelisting/validation in the newer build. Any guidance or hotfixes would be highly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions