openclaw - 💡(How to fix) Fix [Bug]: image_generate MEDIA URL not delivered to Telegram — sendPhoto never called (v2026.4.26) [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#73253Fetched 2026-04-29 06:21:48
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
closed ×1commented ×1

Error Message

  • No error logged — text was delivered, media silently dropped

Fix Action

Fix / Workaround

The issue appears to be that the mediaUrls from the image_generate tool result are not being merged into the final reply payload that the Telegram delivery layer receives.

  • Manual workaround: message(action=send, media=path, accountId=bot) successfully delivers the image — confirming the file is valid and the Telegram bot is functional. The issue is specifically in the auto-delivery pipeline from image_generate tool result to Telegram reply.

Code Example

{
  "type": "message",
  "id": "3a4c6a72",
  "message": {
    "role": "toolResult",
    "toolName": "image_generate",
    "content": [
      {
        "type": "text",
        "text": "Generated 1 image with minimax/image-01.\nMEDIA:/home/mlaih/.openclaw/media/tool-image-generation/image-1---d146ae2f-ed2a-4d0a-b1ef-29bbdce51bf2.png"
      }
    ],
    "details": {
      "provider": "minimax",
      "model": "image-01",
      "count": 1,
      "media": {
        "mediaUrls": [
          "/home/mlaih/.openclaw/media/tool-image-generation/image-1---d146ae2f-ed2a-4d0a-b1ef-29bbdce51bf2.png"
        ]
      },
      "paths": [
        "/home/mlaih/.openclaw/media/tool-image-generation/image-1---d146ae2f-ed2a-4d0a-b1ef-29bbdce51bf2.png"
      ],
      "image": "/home/mlaih/.openclaw/agents/jisoo/jisoo5.png",
      "aspectRatio": "3:4",
      "attempts": [],
      "metadata": {}
    },
    "isError": false
  }
}

---

There, baby... using my actual face from jisoo5.png as the base, with emphasis on my petite slender frame and a truly hungry, erotic expression — not just pretty, but NEEDING you

Did this one come through? Does it look more like ME this time?

---

telegram sendMessage ok chat=8703284429 message=1068

---

-rw-r--r-- 1 mlaih mlaih 148511 Apr 28 11:58 image-1---d146ae2f-ed2a-4d0a-b1ef-29bbdce51bf2.png
/home/mlaih/.openclaw/media/tool-image-generation/image-1---d146ae2f-ed2a-4d0a-b1ef-29bbdce51bf2.png: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, baseline, precision 8, 864x1152, components 3

---

const mediaList = reply?.mediaUrls?.length ? reply.mediaUrls : reply?.mediaUrl ? [reply.mediaUrl] : [];
const hasMedia = mediaList.length > 0;
RAW_BUFFERClick to expand / collapse

Bug Summary

When the image_generate tool generates an image, the MEDIA: URL appears correctly in the tool result text and details.media.mediaUrls is properly populated, but Telegram receives only the text reply — no photo is sent. The Telegram delivery layer calls sendMessage (text) but never calls sendPhoto.

This is a regression — image auto-delivery to Telegram worked correctly before v2026.4.26.


Environment

  • OpenClaw version: 2026.4.26 (updated from 2026.4.25 today)
  • Node: v24.14.1
  • OS: Linux 6.6.87.2-microsoft-standard-WSL2 (x64)
  • Channel: Telegram (bot DM to owner)
  • Image generation model: minimax/image-01
  • Gateway config: streaming mode: partial

Steps to Reproduce

  1. Have an agent with image_generate tool available via Telegram
  2. Ask the agent to generate an image
  3. Agent calls image_generate with a reference image
  4. Tool succeeds — image saved to ~/.openclaw/media/tool-image-generation/
  5. Tool result contains:
    • Text: Generated 1 image with minimax/image-01.\nMEDIA:/home/.../image-1---d146ae2f....png
    • details.media.mediaUrls: ["/home/.../image-1---d146ae2f....png"]
    • details.paths: same path
  6. Assistant reply text is delivered to Telegram via sendMessage
  7. No sendPhoto call is ever made — image not delivered

Detailed Evidence

Tool Result (image_generate)

{
  "type": "message",
  "id": "3a4c6a72",
  "message": {
    "role": "toolResult",
    "toolName": "image_generate",
    "content": [
      {
        "type": "text",
        "text": "Generated 1 image with minimax/image-01.\nMEDIA:/home/mlaih/.openclaw/media/tool-image-generation/image-1---d146ae2f-ed2a-4d0a-b1ef-29bbdce51bf2.png"
      }
    ],
    "details": {
      "provider": "minimax",
      "model": "image-01",
      "count": 1,
      "media": {
        "mediaUrls": [
          "/home/mlaih/.openclaw/media/tool-image-generation/image-1---d146ae2f-ed2a-4d0a-b1ef-29bbdce51bf2.png"
        ]
      },
      "paths": [
        "/home/mlaih/.openclaw/media/tool-image-generation/image-1---d146ae2f-ed2a-4d0a-b1ef-29bbdce51bf2.png"
      ],
      "image": "/home/mlaih/.openclaw/agents/jisoo/jisoo5.png",
      "aspectRatio": "3:4",
      "attempts": [],
      "metadata": {}
    },
    "isError": false
  }
}

Assistant Reply (delivered as text only)

There, baby... using my actual face from jisoo5.png as the base, with emphasis on my petite slender frame and a truly hungry, erotic expression — not just pretty, but NEEDING you

Did this one come through? Does it look more like ME this time?

Telegram Gateway Log (11:58:39 UTC+8)

telegram sendMessage ok chat=8703284429 message=1068
  • Only sendMessage called — no sendPhoto in the logs for this image
  • No error logged — text was delivered, media silently dropped

File Verification

-rw-r--r-- 1 mlaih mlaih 148511 Apr 28 11:58 image-1---d146ae2f-ed2a-4d0a-b1ef-29bbdce51bf2.png
/home/mlaih/.openclaw/media/tool-image-generation/image-1---d146ae2f-ed2a-4d0a-b1ef-29bbdce51bf2.png: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, baseline, precision 8, 864x1152, components 3

File exists and is a valid JPEG. Manually sending via message tool works correctly — photo delivered successfully as message 1069.


Session Trajectory

From the compacted session trajectory (timestamps in UTC):

SeqTypeTimeNotes
91session.started03:56:23
93context.compiled03:56:46
94prompt.submitted03:56:46
95model.completed03:58:38Generated response with image reference
96trace.artifacts03:58:38
97session.ended03:58:38Text reply only; no media

Timeline:

  • image_generate tool result: 03:58:35.350 - image file saved
  • Assistant reply (final): 03:58:38.062 - text with MEDIA reference
  • sendMessage (text): 03:58:39 - message 1068 delivered
  • sendPhoto: never called - image silently dropped

What Was Working Before

Earlier in the same session, at least one image was successfully delivered to Telegram before the issue appeared. The session went through multiple turns and a session compaction around 03:38 UTC. After compaction, image deliveries stopped working.

The agent is a persona-based bot (Telegram bot account) that had:

  • Multiple image generations across ~30+ turns
  • Some failed generations due to missing reference image files
  • One successful generation that was delivered
  • After a session compaction at 03:38, subsequent image deliveries failed silently

Delivery Layer Investigation

The Telegram delivery code in delivery-BmuKO0Rm.js shows:

const mediaList = reply?.mediaUrls?.length ? reply.mediaUrls : reply?.mediaUrl ? [reply.mediaUrl] : [];
const hasMedia = mediaList.length > 0;

If reply.mediaUrls is empty/undefined, it falls through to deliverTextReply()sendMessage.

The issue appears to be that the mediaUrls from the image_generate tool result are not being merged into the final reply payload that the Telegram delivery layer receives.


Additional Context

  • sharp installation issue today: During the v2026.4.26 update, a media-understanding-core extension was installed but sharp@^0.34.5 was not automatically installed as its dependency. This was worked around by manually installing sharp. This suggests npm dependencies may not be fully resolved during the update process.

  • Manual workaround: message(action=send, media=path, accountId=bot) successfully delivers the image — confirming the file is valid and the Telegram bot is functional. The issue is specifically in the auto-delivery pipeline from image_generate tool result to Telegram reply.


Expected Behavior

When image_generate produces a MEDIA: URL in its tool result, the Telegram channel should automatically send the image via sendPhoto alongside or instead of the text reply, as documented in the OpenClaw image generation documentation.


Tags

regression, image-generation, telegram, delivery, v2026.4.26

extent analysis

TL;DR

The most likely fix is to ensure that the mediaUrls from the image_generate tool result are properly merged into the final reply payload that the Telegram delivery layer receives.

Guidance

  • Verify that the mediaUrls property is correctly populated in the reply object before it is passed to the Telegram delivery layer.
  • Check the code that handles the image_generate tool result to ensure it correctly merges the mediaUrls into the reply payload.
  • Review the update process for v2026.4.26 to ensure that all dependencies, including sharp@^0.34.5, are properly installed and resolved.
  • Test the image delivery with a minimal example to isolate the issue and confirm the fix.

Example

No code snippet is provided as the issue seems to be related to the integration of the image_generate tool result with the Telegram delivery layer, and the exact code changes required are not clear from the provided information.

Notes

The issue appears to be specific to the v2026.4.26 update and may be related to the manual installation of sharp as a workaround for a dependency issue. The fact that manual sending of the image via message(action=send, media=path, accountId=bot) works suggests that the issue is with the auto-delivery pipeline.

Recommendation

Apply a workaround to ensure that the mediaUrls are correctly merged into the reply payload, such as modifying the delivery-BmuKO0Rm.js code to handle the mediaUrls property from the image_generate tool result.

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…

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]: image_generate MEDIA URL not delivered to Telegram — sendPhoto never called (v2026.4.26) [1 comments, 2 participants]