openclaw - 💡(How to fix) Fix [Bug]: image_generate auto-delivery silently does nothing in WhatsApp group sessions [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#60079Fetched 2026-04-08 02:36:40
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

The image_generate tool successfully generates images and saves them to ~/.openclaw/media/tool-image-generation/, but the auto-delivery mechanism never fires when the agent session is a WhatsApp group chat. No error, no warning, no log entry — the image simply never reaches the group. The same image path delivered via explicit message(filePath=...) works perfectly.

Error Message

The image_generate tool successfully generates images and saves them to ~/.openclaw/media/tool-image-generation/, but the auto-delivery mechanism never fires when the agent session is a WhatsApp group chat. No error, no warning, no log entry — the image simply never reaches the group. The same image path delivered via explicit message(filePath=...) works perfectly. 3. Observe: tool returns Generated 1 image with fal/... (success, no error)

  • Zero log activity after generation: no delivery attempt, no error, no callback fired

Root Cause

Root Cause Hypothesis

Fix Action

Workaround

Explicitly call the message tool after image_generate: image_generate to get the path from details.media.mediaUrls, then message(filePath=path, target=group-jid, channel=whatsapp)

RAW_BUFFERClick to expand / collapse

Summary

The image_generate tool successfully generates images and saves them to ~/.openclaw/media/tool-image-generation/, but the auto-delivery mechanism never fires when the agent session is a WhatsApp group chat. No error, no warning, no log entry — the image simply never reaches the group. The same image path delivered via explicit message(filePath=...) works perfectly.

Environment

ComponentValue
OpenClaw2026.3.28 (f9b1079)
OSUbuntu 22.04 (VPS)
ChannelWhatsApp (Baileys)
Sandbox modenot configured (default off)
Install methodnpm install -g openclaw

Steps to Reproduce

  1. Configure a WhatsApp group in OpenClaw (new-style JID: [email protected])
  2. In a group chat session, call image_generate with any prompt
  3. Observe: tool returns Generated 1 image with fal/... (success, no error)
  4. Check the WhatsApp group: no image received

Expected Behavior

image_generate documentation states: Generated images are delivered automatically from the tool result as MEDIA paths.

The image should be delivered to the active session channel (WhatsApp group) automatically, same as DMs.

Actual Behavior

  • Image is generated and saved to disk
  • Zero log activity after generation: no delivery attempt, no error, no callback fired
  • WhatsApp group receives nothing

Log Evidence

During image_generate call in a group session: no log output at all

During explicit message(filePath=...) to same group: 2026-04-03T10:19:55 sending message {jid: sha256:..., hasMedia: true} 2026-04-03T10:19:57 sent message {jid: sha256:..., messageId: 3EB0C517...}

The explicit message tool path works. The image_generate auto-delivery path never triggers.

Contrast: DM Sessions

Auto-delivery via image_generate works correctly in WhatsApp DM sessions. The onBlockReply callback and consumePendingToolMedia path appear to not be wired for group sessions.

Root Cause Hypothesis

The pendingToolMediaUrls queue gets populated when image_generate completes, but the onBlockReply callback that drains this queue via consumePendingToolMediaIntoReply / consumePendingToolMediaReply may not be registered for WhatsApp group agent sessions — or the group session delivery context does not include the mediaLocalRoots needed for loadWebMedia to resolve the path.

Workaround

Explicitly call the message tool after image_generate: image_generate to get the path from details.media.mediaUrls, then message(filePath=path, target=group-jid, channel=whatsapp)

Related Issues

  • #54445 different root cause (sandbox path validation) but same symptom
  • #52167 WhatsApp media on old-style JIDs (different issue, we use new-style JIDs)

extent analysis

TL;DR

The most likely fix is to explicitly call the message tool after image_generate to deliver the generated image to the WhatsApp group.

Guidance

  • Verify that the onBlockReply callback is registered for WhatsApp group agent sessions to ensure the consumePendingToolMedia path is executed.
  • Check the mediaLocalRoots configuration to ensure it includes the necessary paths for loadWebMedia to resolve the generated image path.
  • Use the provided workaround: explicitly call the message tool after image_generate to deliver the image to the WhatsApp group.
  • Review related issues #54445 and #52167 to ensure the problem is not related to sandbox path validation or old-style JIDs.

Example

// Explicitly call the message tool after image_generate
const imagePath = details.media.mediaUrls[0];
message({ filePath: imagePath, target: 'group-jid', channel: 'whatsapp' });

Notes

The root cause of the issue appears to be related to the onBlockReply callback not being registered for WhatsApp group agent sessions or the group session delivery context not including the necessary mediaLocalRoots. The provided workaround should resolve the issue, but further investigation is needed to determine the underlying cause.

Recommendation

Apply the workaround by explicitly calling the message tool after image_generate to deliver the generated image to the WhatsApp group, as this approach has been verified to work in the provided example.

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