openclaw - ✅(Solved) Fix [Bug]: Telegram: read tool for images succeeds internally but fails to deliver file to user. [1 pull requests, 1 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#56306Fetched 2026-04-08 01:42:28
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×2cross-referenced ×1referenced ×1

When an agent is instructed to send an image file to a user on Telegram, the read(file="...") tool is executed. The agent's internal logs show that the tool successfully reads the image file from its local storage. However, the image is never delivered to the end-user on Telegram. No error message is shown to the user; the message is simply dropped.

This issue has been reproduced with both pre-existing local files and with files downloaded from a public URL during the session. Text-based messages work correctly, but this core file-sending feature appears to be broken at the platform level.

Error Message

When an agent is instructed to send an image file to a user on Telegram, the read(file="...") tool is executed. The agent's internal logs show that the tool successfully reads the image file from its local storage. However, the image is never delivered to the end-user on Telegram. No error message is shown to the user; the message is simply dropped. 6. User-side Observation: The user in the Telegram client receives nothing. No image, no message, no error. 6. User-side Observation: The user in the Telegram client receives nothing. No image, no message, no error.

Root Cause

When an agent is instructed to send an image file to a user on Telegram, the read(file="...") tool is executed. The agent's internal logs show that the tool successfully reads the image file from its local storage. However, the image is never delivered to the end-user on Telegram. No error message is shown to the user; the message is simply dropped.

This issue has been reproduced with both pre-existing local files and with files downloaded from a public URL during the session. Text-based messages work correctly, but this core file-sending feature appears to be broken at the platform level.

Fix Action

Fix / Workaround

• The read tool itself is not failing; it successfully processes the file from the agent's perspective. • This is not a file permissions or access issue on the agent's side. • This is not a general connectivity issue, as text messages are sent and received correctly. • As a workaround, we successfully used the exec tool with curl to upload the image to a third-party file-sharing service (transfer.whalebone.io) and then shared the resulting URL. This confirms: • The image file itself is valid. • The agent's environment has network access for egress via curl.

PR fix notes

PR #56331: delete

Description (problem / solution / changelog)

delete

Changed files

  • 2026-03-28.md (added, +384/-0)
  • AGENTS.md (modified, +21/-0)
  • extensions/ollama/src/provider-models.ts (modified, +3/-0)
  • extensions/telegram/src/bot-native-commands.test.ts (modified, +61/-0)
  • extensions/telegram/src/bot-native-commands.ts (modified, +4/-1)
  • src/agents/command/session.ts (modified, +11/-0)
  • src/agents/pi-tools.read.media-url.test.ts (added, +130/-0)
  • src/agents/pi-tools.read.ts (modified, +40/-5)
  • src/config/sessions/store-validation.test.ts (added, +151/-0)
  • src/config/sessions/store-validation.ts (added, +81/-0)
  • src/config/sessions/store.ts (modified, +15/-1)
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

When an agent is instructed to send an image file to a user on Telegram, the read(file="...") tool is executed. The agent's internal logs show that the tool successfully reads the image file from its local storage. However, the image is never delivered to the end-user on Telegram. No error message is shown to the user; the message is simply dropped.

This issue has been reproduced with both pre-existing local files and with files downloaded from a public URL during the session. Text-based messages work correctly, but this core file-sending feature appears to be broken at the platform level.

Steps to reproduce

  1. Start a conversation with an OpenClaw agent via the Telegram channel.
  2. Ensure an image file (e.g., image.jpg) is present in the agent's workspace.
  3. Instruct the agent to send the image file (e.g., "send me image.jpg").
  4. The agent executes the read(file="image.jpg") tool.
  5. Agent-side Observation: The agent receives a successful tool output, similar to {"read_response": {"output": "Read image file [image/jpeg]"}}. This indicates the file was read from disk correctly.
  6. User-side Observation: The user in the Telegram client receives nothing. No image, no message, no error.

Expected behavior

  1. Start a conversation with an OpenClaw agent via the Telegram channel.
  2. Ensure an image file (e.g., image.jpg) is present in the agent's workspace.
  3. Instruct the agent to send the image file (e.g., "send me image.jpg").
  4. The agent executes the read(file="image.jpg") tool.
  5. Agent-side Observation: The agent receives a successful tool output, similar to {"read_response": {"output": "Read image file [image/jpeg]"}}. This indicates the file was read from disk correctly.
  6. User-side Observation: The user in the Telegram client receives nothing. No image, no message, no error.

Actual behavior

• The read tool itself is not failing; it successfully processes the file from the agent's perspective. • This is not a file permissions or access issue on the agent's side. • This is not a general connectivity issue, as text messages are sent and received correctly. • As a workaround, we successfully used the exec tool with curl to upload the image to a third-party file-sharing service (transfer.whalebone.io) and then shared the resulting URL. This confirms: • The image file itself is valid. • The agent's environment has network access for egress via curl.

OpenClaw version

2026.3.24

Operating system

ubuntu

Install method

npm g

Model

gemini 2.5 pro - vertex ai

Provider / routing chain

openclaw -> google-vertex/gemini-2.5-pro

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

Fix Plan

To fix the issue of the image file not being delivered to the end-user on Telegram, we need to modify the code that handles file sending.

  • Check the Telegram API documentation to ensure that the file sending endpoint is being used correctly.
  • Verify that the file is being read correctly and that the contents are being sent to the Telegram API.
  • Use the Telegram API to send files, which requires a different approach than sending text messages.

Here is an example of how to send a file using the Telegram Bot API:

import requests

def send_file(chat_id, file_path):
    url = f"https://api.telegram.org/bot{TOKEN}/sendDocument"
    files = {'document': open(file_path, 'rb')}
    params = {'chat_id': chat_id}
    response = requests.post(url, params=params, files=files)
    return response.json()

# Example usage:
chat_id = 123456789
file_path = "image.jpg"
response = send_file(chat_id, file_path)
print(response)

Make sure to replace TOKEN with your actual Telegram bot token.

Verification

To verify that the fix worked, try sending an image file to a user on Telegram using the modified code. Check that the image is delivered correctly and that no error messages are shown to the user.

Extra Tips

  • Make sure to handle errors and exceptions properly when sending files to avoid crashes or unexpected behavior.
  • Consider adding logging to track file sending attempts and errors for debugging purposes.
  • Review the Telegram API documentation to ensure that you are using the latest and most efficient methods for sending files.

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

  1. Start a conversation with an OpenClaw agent via the Telegram channel.
  2. Ensure an image file (e.g., image.jpg) is present in the agent's workspace.
  3. Instruct the agent to send the image file (e.g., "send me image.jpg").
  4. The agent executes the read(file="image.jpg") tool.
  5. Agent-side Observation: The agent receives a successful tool output, similar to {"read_response": {"output": "Read image file [image/jpeg]"}}. This indicates the file was read from disk correctly.
  6. User-side Observation: The user in the Telegram client receives nothing. No image, no message, no error.

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 - ✅(Solved) Fix [Bug]: Telegram: read tool for images succeeds internally but fails to deliver file to user. [1 pull requests, 1 participants]