Fix WhatsApp media sends when mediaUrl is empty but mediaUrls is populated#64394
Conversation
Greptile SummaryThis PR fixes a silent downgrade in WhatsApp outbound sends where Confidence Score: 5/5Safe to merge — targeted fix with no behavioral regression on the existing path and a covering test for the new fallback. The change is minimal and strictly additive: it computes No files require special attention. Reviews (1): Last reviewed commit: "Fix WhatsApp media fallback" | Re-trigger Greptile |
116d86e to
e3e6b73
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e3e6b73e86
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Accept the first mediaUrls entry when mediaUrl is empty so outbound WhatsApp sends do not silently downgrade media messages to text. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
e3e6b73 to
23cbeaa
Compare
…lated (openclaw#64394) * Fix WhatsApp media fallback Accept the first mediaUrls entry when mediaUrl is empty so outbound WhatsApp sends do not silently downgrade media messages to text. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore(changelog): credit WhatsApp mediaUrls fallback * fix(changelog): restore 2026.4.10 release block --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
…lated (openclaw#64394) * Fix WhatsApp media fallback Accept the first mediaUrls entry when mediaUrl is empty so outbound WhatsApp sends do not silently downgrade media messages to text. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore(changelog): credit WhatsApp mediaUrls fallback * fix(changelog): restore 2026.4.10 release block --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
…lated (openclaw#64394) * Fix WhatsApp media fallback Accept the first mediaUrls entry when mediaUrl is empty so outbound WhatsApp sends do not silently downgrade media messages to text. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore(changelog): credit WhatsApp mediaUrls fallback * fix(changelog): restore 2026.4.10 release block --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
…lated (openclaw#64394) * Fix WhatsApp media fallback Accept the first mediaUrls entry when mediaUrl is empty so outbound WhatsApp sends do not silently downgrade media messages to text. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore(changelog): credit WhatsApp mediaUrls fallback * fix(changelog): restore 2026.4.10 release block --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
…lated (openclaw#64394) * Fix WhatsApp media fallback Accept the first mediaUrls entry when mediaUrl is empty so outbound WhatsApp sends do not silently downgrade media messages to text. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore(changelog): credit WhatsApp mediaUrls fallback * fix(changelog): restore 2026.4.10 release block --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
…lated (openclaw#64394) * Fix WhatsApp media fallback Accept the first mediaUrls entry when mediaUrl is empty so outbound WhatsApp sends do not silently downgrade media messages to text. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore(changelog): credit WhatsApp mediaUrls fallback * fix(changelog): restore 2026.4.10 release block --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
Fix WhatsApp media sends when outbound flow uses
mediaUrlsSummary
This fixes a WhatsApp outbound regression where
openclaw message send --media ...can return a message ID but still send a text-only message.In the affected runtime path, the WhatsApp sender only checks
options.mediaUrl, while the upstream send flow can populate attachments viaoptions.mediaUrls.When
mediaUrlis empty andmediaUrlscontains the attachment, the outbound send silently downgrades to text.Reproduction
openclaw message send --channel whatsapp --to ... --media ....Root cause
sendMessageWhatsApp()only looks atoptions.mediaUrlwhen deciding whether the outbound message includes media.However, the surrounding send flow can provide attachments in
options.mediaUrls.Fix
Normalize
options.mediaUrlsand fall back to the first valid entry whenoptions.mediaUrlis empty.Why this is safe
mediaUrlis already setmediaUrlpathmediaUrlsarrayValidation
Before:
After:
The same test then delivers the actual WhatsApp image instead of a text-only message.