openclaw - 💡(How to fix) Fix [Bug]: WhatsApp agent reply `MEDIA:` directives are dropped before channel send, but `openclaw message send --media` works [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#78578Fetched 2026-05-07 03:35:04
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
2
Timeline (top)
mentioned ×2subscribed ×2commented ×1cross-referenced ×1

On OpenClaw 2026.5.6 with the WhatsApp channel, assistant replies containing a MEDIA: directive are not being delivered as attachments and no WhatsApp media-send log entry is produced. The same image file sends successfully to the same WhatsApp recipient using openclaw message send --media, so the WhatsApp media layer itself appears functional.

This looks like an agent/rich-output/final-reply media extraction or dispatch regression rather than a WhatsApp upload failure.

Error Message

2026-05-06T11:25:37.321-06:00 [ws] failed to load ws message handler ... Cannot find module ... 2026-05-06T11:25:40.609-06:00 [reload] config change requires gateway restart ... 2026-05-06T11:25:56.198-06:00 [gateway] shutdown error: Error [ERR_MODULE_NOT_FOUND] ...

Root Cause

Likely in the assistant final-reply rich-output/media directive parser or the handoff from parsed assistant MEDIA: attachments into the WhatsApp reply payload path. The WhatsApp outbound media path itself seems OK because openclaw message send --media works with the same file and recipient.

Fix Action

Workaround

For now, generated images can be sent manually/externally via:

openclaw message send --channel whatsapp --account default --target <recipient> --media <path> --message <caption>

But agent-authored MEDIA: replies do not currently dispatch reliably in this WhatsApp direct session.

Code Example

MEDIA:/Users/iris/.openclaw/media/tool-image-generation/post-update-whatsapp-image-test---fc4ae0c9-0eb6-4046-919b-6eb565602bf5.png

---

MEDIA:media/whatsapp-tests/post-update-sprite.jpg

---

openclaw message send \
  --channel whatsapp \
  --account default \
  --target +17209341155 \
  --media media/whatsapp-tests/post-update-sprite.jpg \
  --message "Direct CLI media send test after scope approval" \
  --json

---

{
  "action": "send",
  "channel": "whatsapp",
  "dryRun": false,
  "handledBy": "core",
  "payload": {
    "channel": "whatsapp",
    "to": "+17209341155",
    "via": "gateway",
    "mediaUrl": "media/whatsapp-tests/post-update-sprite.jpg",
    "mediaUrls": ["media/whatsapp-tests/post-update-sprite.jpg"],
    "result": {
      "runId": "7e3c113a-18d9-44d4-9e0d-516049619240",
      "messageId": "3EB07B63745D547EF92121",
      "channel": "whatsapp",
      "toJid": "[email protected]"
    }
  }
}

---

2026-05-06T07:18:15.600-06:00 [whatsapp] Sent media reply to +17209341155 (3.01MB)
2026-05-06T07:25:09.985-06:00 [whatsapp] Sent media reply to +17209341155 (2.71MB)

---

2026-05-06T11:40:45.688-06:00 [whatsapp] Inbound message +17209341155 -> +17207680251 (direct, 285 chars)
2026-05-06T11:40:54.020-06:00 [image-generation/openai] image auth selected: provider=openai-codex mode=oauth transport=codex-responses requestedModel=gpt-image-2 responsesModel=gpt-5.5 timeoutMs=120000
2026-05-06T11:42:24.010-06:00 [whatsapp] Inbound message +17209341155 -> +17207680251 (direct, 71 chars)

---

2026-05-06T11:43:49.356-06:00 [whatsapp] Inbound message +17209341155 -> +17207680251 (direct, 69 chars)

---

2026-05-06T11:25:37.321-06:00 [ws] failed to load ws message handler ... Cannot find module ...
2026-05-06T11:25:40.609-06:00 [reload] config change requires gateway restart ...
2026-05-06T11:25:56.198-06:00 [gateway] shutdown error: Error [ERR_MODULE_NOT_FOUND] ...

---

openclaw message send --channel whatsapp --account default --target <recipient> --media <path> --message <caption>
RAW_BUFFERClick to expand / collapse

Bug report draft: WhatsApp agent reply MEDIA directives are not dispatched, while direct message send --media works

Title

[Bug]: WhatsApp agent reply MEDIA: directives are dropped before channel send, but openclaw message send --media works

Summary

On OpenClaw 2026.5.6 with the WhatsApp channel, assistant replies containing a MEDIA: directive are not being delivered as attachments and no WhatsApp media-send log entry is produced. The same image file sends successfully to the same WhatsApp recipient using openclaw message send --media, so the WhatsApp media layer itself appears functional.

This looks like an agent/rich-output/final-reply media extraction or dispatch regression rather than a WhatsApp upload failure.

Environment

  • OpenClaw: 2026.5.6 (c97b9f7)
  • OS: macOS 26.3 arm64
  • Node: v22.22.2
  • Channel: WhatsApp via @openclaw/whatsapp
  • Gateway: local LaunchAgent, loopback, WhatsApp account connected/OK
  • Session: WhatsApp direct chat
  • Model/runtime: openai-codex/gpt-5.5

openclaw status reports WhatsApp OK and no task queue issues.

What happened

Earlier in the same day/session, generated image attachments delivered successfully via assistant MEDIA: replies. Later, after updates/restarts and media/voice-note testing, assistant replies with MEDIA: lines stopped producing WhatsApp media sends.

Current behavior on 2026.5.6:

  1. Generate an image using the built-in image_generate tool.

  2. Assistant replies with a line like:

    MEDIA:/Users/iris/.openclaw/media/tool-image-generation/post-update-whatsapp-image-test---fc4ae0c9-0eb6-4046-919b-6eb565602bf5.png
  3. User receives no image.

  4. Gateway logs show image generation, but no corresponding [whatsapp] Sent media reply ... entry.

Then, converting the same image to a small JPEG under the workspace and replying with:

MEDIA:media/whatsapp-tests/post-update-sprite.jpg

also produced no WhatsApp media-send log and no image delivery.

However, sending the exact same JPEG via CLI works:

openclaw message send \
  --channel whatsapp \
  --account default \
  --target +17209341155 \
  --media media/whatsapp-tests/post-update-sprite.jpg \
  --message "Direct CLI media send test after scope approval" \
  --json

Result:

{
  "action": "send",
  "channel": "whatsapp",
  "dryRun": false,
  "handledBy": "core",
  "payload": {
    "channel": "whatsapp",
    "to": "+17209341155",
    "via": "gateway",
    "mediaUrl": "media/whatsapp-tests/post-update-sprite.jpg",
    "mediaUrls": ["media/whatsapp-tests/post-update-sprite.jpg"],
    "result": {
      "runId": "7e3c113a-18d9-44d4-9e0d-516049619240",
      "messageId": "3EB07B63745D547EF92121",
      "channel": "whatsapp",
      "toJid": "[email protected]"
    }
  }
}

The user confirmed that this CLI-sent image arrived.

Expected behavior

An assistant reply containing a valid local MEDIA: directive should be parsed and dispatched to the WhatsApp channel as a media reply, just like earlier successful generated image replies and just like direct openclaw message send --media.

Actual behavior

The assistant reply text containing MEDIA: does not result in any WhatsApp media send. The user receives no image, and the gateway logs do not show a media-send attempt for the assistant reply.

Relevant log excerpts

Successful earlier generated-card sends via assistant reply:

2026-05-06T07:18:15.600-06:00 [whatsapp] Sent media reply to +17209341155 (3.01MB)
2026-05-06T07:25:09.985-06:00 [whatsapp] Sent media reply to +17209341155 (2.71MB)

Post-update direct assistant MEDIA: attempt shows image generation but no media send:

2026-05-06T11:40:45.688-06:00 [whatsapp] Inbound message +17209341155 -> +17207680251 (direct, 285 chars)
2026-05-06T11:40:54.020-06:00 [image-generation/openai] image auth selected: provider=openai-codex mode=oauth transport=codex-responses requestedModel=gpt-image-2 responsesModel=gpt-5.5 timeoutMs=120000
2026-05-06T11:42:24.010-06:00 [whatsapp] Inbound message +17209341155 -> +17207680251 (direct, 71 chars)

Post-update workspace JPEG assistant MEDIA: attempt also produced no media-send log:

2026-05-06T11:43:49.356-06:00 [whatsapp] Inbound message +17209341155 -> +17207680251 (direct, 69 chars)

Direct CLI media send works and user confirmed receipt.

Additional context

During the update/restart sequence there were some transient module-missing errors while the package update replaced the dist tree and the gateway restarted, but the gateway later came back clean on 2026.5.6 and WhatsApp reported OK.

Examples from the update window:

2026-05-06T11:25:37.321-06:00 [ws] failed to load ws message handler ... Cannot find module ...
2026-05-06T11:25:40.609-06:00 [reload] config change requires gateway restart ...
2026-05-06T11:25:56.198-06:00 [gateway] shutdown error: Error [ERR_MODULE_NOT_FOUND] ...

After restart/status checks:

  • Gateway reachable
  • WhatsApp OK
  • No active/queued task issues
  • Direct CLI WhatsApp media send succeeds

Suspected area

Likely in the assistant final-reply rich-output/media directive parser or the handoff from parsed assistant MEDIA: attachments into the WhatsApp reply payload path. The WhatsApp outbound media path itself seems OK because openclaw message send --media works with the same file and recipient.

Workaround

For now, generated images can be sent manually/externally via:

openclaw message send --channel whatsapp --account default --target <recipient> --media <path> --message <caption>

But agent-authored MEDIA: replies do not currently dispatch reliably in this WhatsApp direct session.

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

An assistant reply containing a valid local MEDIA: directive should be parsed and dispatched to the WhatsApp channel as a media reply, just like earlier successful generated image replies and just like direct openclaw message send --media.

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]: WhatsApp agent reply `MEDIA:` directives are dropped before channel send, but `openclaw message send --media` works [1 comments, 2 participants]