openclaw - 💡(How to fix) Fix WhatsApp: message tool sendMedia not wired after plugin refactoring (2026.4.6-beta.1) [2 comments, 3 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#62214Fetched 2026-04-08 03:07:35
View on GitHub
Comments
2
Participants
3
Timeline
2
Reactions
0
Author
Timeline (top)
commented ×2

Error Message

The message tool silently drops media (PDFs, images, documents) when sending via WhatsApp. Text is delivered but the attachment is lost with no error.

  • No error returned to the caller — tool reports success with a messageId

Root Cause

The plugin refactoring in 2026.4.6-beta.1 (commits around Apr 5-6: 1903be5401, 5da21bc2f7, 1e9289f535) broke the wiring of outbound.sendMedia for the WhatsApp channel.

In deliver-CINDNQR1.js, createPluginHandler() reads outbound.sendMedia from the loaded outbound adapter. For WhatsApp, this resolves to undefined, causing:

  1. supportsMedia: Boolean(sendMedia)false
  2. handler.sendMedia() silently falls back to sendText() (line ~555-564):
sendMedia: async (caption, mediaUrl, overrides) => {
    if (sendMedia) return sendMedia({...ctx, text: caption, mediaUrl});
    return sendText({...ctx, text: caption}); // mediaUrl silently dropped!
}
  1. WhatsApp sendText does not accept/forward mediaUrl, so sendMessageWhatsApp() is called without media

The WhatsApp adapter does define sendMedia in send-Bggsiuoi.js:219, but the plugin registry loader (loadChannelOutboundAdapterentry.plugin.outbound) returns an adapter where sendMedia is undefined.

Fix Action

Workaround

Patch two compiled files:

1. deliver-CINDNQR1.js (~line 562): Pass mediaUrl in the sendText fallback:

// Before:
return sendText({...resolveCtx(overrides), text: caption});
// After:
return sendText({...resolveCtx(overrides), text: caption, mediaUrl});

2. send-Bggsiuoi.js (~line 209): Accept and forward media params in WhatsApp sendText:

// Before:
sendText: async ({ cfg, to, text, accountId, deps, gifPlayback }) => {
// After:
sendText: async ({ cfg, to, text, accountId, deps, gifPlayback, mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile }) => {
    // ...and forward mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile to sendMessageWhatsApp options

Code Example

sendMedia: async (caption, mediaUrl, overrides) => {
    if (sendMedia) return sendMedia({...ctx, text: caption, mediaUrl});
    return sendText({...ctx, text: caption}); // mediaUrl silently dropped!
}

---

DIAG-MEDIA: channel=whatsapp mediaUrls=["/path/to/file.pdf"]  ← arrives at delivery layer
DIAG-WA:    to=+44... hasMedia=false mediaUrl=undefined        ← lost before WhatsApp send

---

// Before:
return sendText({...resolveCtx(overrides), text: caption});
// After:
return sendText({...resolveCtx(overrides), text: caption, mediaUrl});

---

// Before:
sendText: async ({ cfg, to, text, accountId, deps, gifPlayback }) => {
// After:
sendText: async ({ cfg, to, text, accountId, deps, gifPlayback, mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile }) => {
    // ...and forward mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile to sendMessageWhatsApp options
RAW_BUFFERClick to expand / collapse

Bug

The message tool silently drops media (PDFs, images, documents) when sending via WhatsApp. Text is delivered but the attachment is lost with no error.

Root Cause

The plugin refactoring in 2026.4.6-beta.1 (commits around Apr 5-6: 1903be5401, 5da21bc2f7, 1e9289f535) broke the wiring of outbound.sendMedia for the WhatsApp channel.

In deliver-CINDNQR1.js, createPluginHandler() reads outbound.sendMedia from the loaded outbound adapter. For WhatsApp, this resolves to undefined, causing:

  1. supportsMedia: Boolean(sendMedia)false
  2. handler.sendMedia() silently falls back to sendText() (line ~555-564):
sendMedia: async (caption, mediaUrl, overrides) => {
    if (sendMedia) return sendMedia({...ctx, text: caption, mediaUrl});
    return sendText({...ctx, text: caption}); // mediaUrl silently dropped!
}
  1. WhatsApp sendText does not accept/forward mediaUrl, so sendMessageWhatsApp() is called without media

The WhatsApp adapter does define sendMedia in send-Bggsiuoi.js:219, but the plugin registry loader (loadChannelOutboundAdapterentry.plugin.outbound) returns an adapter where sendMedia is undefined.

Evidence

DIAG-MEDIA: channel=whatsapp mediaUrls=["/path/to/file.pdf"]  ← arrives at delivery layer
DIAG-WA:    to=+44... hasMedia=false mediaUrl=undefined        ← lost before WhatsApp send

Gateway log confirms: Sent message XXX -> ... (734ms) — no (media) suffix, meaning sendMessageWhatsApp received no options.mediaUrl.

Impact

  • All media sent via the message tool to WhatsApp is silently dropped
  • No error returned to the caller — tool reports success with a messageId
  • Generated images (via agent reply path) still work because they use a different delivery mechanism
  • Affects both images and documents (PDFs, etc.)

Workaround

Patch two compiled files:

1. deliver-CINDNQR1.js (~line 562): Pass mediaUrl in the sendText fallback:

// Before:
return sendText({...resolveCtx(overrides), text: caption});
// After:
return sendText({...resolveCtx(overrides), text: caption, mediaUrl});

2. send-Bggsiuoi.js (~line 209): Accept and forward media params in WhatsApp sendText:

// Before:
sendText: async ({ cfg, to, text, accountId, deps, gifPlayback }) => {
// After:
sendText: async ({ cfg, to, text, accountId, deps, gifPlayback, mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile }) => {
    // ...and forward mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile to sendMessageWhatsApp options

Proper Fix

The outbound adapter loaded by loadChannelOutboundAdapter("whatsapp") should include the sendMedia function. The createAttachedChannelResultAdapter in channel-send-result-6453QwSe.js correctly wraps it, but something in the plugin registry is not exposing outbound.sendMedia on the loaded entry.

Environment

  • OpenClaw 2026.4.6-beta.1
  • WhatsApp channel (Baileys)
  • macOS, Node v24.5.0

extent analysis

TL;DR

The most likely fix for the issue of media being silently dropped when sending via WhatsApp is to patch the deliver-CINDNQR1.js and send-Bggsiuoi.js files to properly handle and forward media parameters.

Guidance

  • Verify that the outbound.sendMedia function is correctly defined and exposed in the WhatsApp adapter loaded by loadChannelOutboundAdapter("whatsapp").
  • Check the plugin registry to ensure that it is correctly registering the sendMedia function for the WhatsApp channel.
  • Apply the provided workaround by patching the deliver-CINDNQR1.js and send-Bggsiuoi.js files to pass and accept media parameters in the sendText fallback.
  • Test the fix by sending media via WhatsApp and verifying that it is delivered correctly.

Example

// Patched deliver-CINDNQR1.js
sendMedia: async (caption, mediaUrl, overrides) => {
    if (sendMedia) return sendMedia({...ctx, text: caption, mediaUrl});
    return sendText({...ctx, text: caption, mediaUrl}); // Pass mediaUrl in sendText fallback
}

// Patched send-Bggsiuoi.js
sendText: async ({ cfg, to, text, accountId, deps, gifPlayback, mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile }) => {
    // Forward mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile to sendMessageWhatsApp options
}

Notes

The provided workaround is a temporary fix, and the proper fix would involve ensuring that the outbound.sendMedia function is correctly defined and exposed in the WhatsApp adapter loaded by loadChannelOutboundAdapter("whatsapp").

Recommendation

Apply the workaround by patching the deliver-CINDNQR1.js and send-Bggsiuoi.js files, as this will allow media to be sent via WhatsApp until a proper fix can be implemented.

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