openclaw - 💡(How to fix) Fix [Bug]: [Bug] Telegram integration fails to send local media (Returns "Media failed") via <final>MEDIA:... [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#74061Fetched 2026-04-30 06:29:13
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
subscribed ×4commented ×1cross-referenced ×1labeled ×1

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

Error Message

The file is not sent. The Telegram chat only receives a fallback error message: ⚠️ Media failed. Alternative Files: Attempted to send different file types and files from different local directories, resulting in the same Media failed error.

Root Cause

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

Fix Action

Fix / Workaround

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.

Code Example

<final>MEDIA:/home/openclaw/.openclaw/workspace/myscreen-agent/src/screenshot.png</final>

---
RAW_BUFFERClick to expand / collapse

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.

extent analysis

TL;DR

The issue can likely be resolved by adjusting the file path handling or multipart/form-data encoding in the Outbound Delivery stage of the OpenClaw Telegram integration.

Guidance

  • Verify that the file path parsing logic in the OpenClaw internal output parser correctly handles absolute paths like /home/openclaw/.openclaw/workspace/myscreen-agent/src/screenshot.png.
  • Check the Nginx reverse proxy configuration to ensure it does not interfere with the file upload process, potentially by modifying the multipart/form-data request.
  • Investigate the directory whitelisting/validation in the newer OpenClaw build to ensure that the directory containing the local media file is properly configured.
  • Consider testing the integration with a simplified file path to isolate if the issue is path-related.

Example

No specific code example can be provided without more details on the OpenClaw internal implementation, but ensuring that the file path is correctly encoded and that the directory is whitelisted could involve adjustments to the internal output parser or the Telegram API request construction.

Notes

The exact fix may depend on the internal workings of the OpenClaw April 26 release and the specifics of the Telegram Bot API integration, which are not fully detailed in the issue description.

Recommendation

Apply a workaround by using remote URLs for file sharing until a more permanent fix can be implemented, as sending remote URLs is reported to work perfectly. This approach avoids the local file path parsing and upload issues altogether.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

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

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: [Bug] Telegram integration fails to send local media (Returns "Media failed") via <final>MEDIA:... [1 comments, 2 participants]