fix(whatsapp): lower upload-file media sends#81883
Conversation
|
Codex review: needs maintainer review before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. Source inspection on current main shows WhatsApp does not advertise or support PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the plugin-owned WhatsApp upload-file lowering after explicit maintainer review and normal CI, keeping core plugin-agnostic while preserving hydrated media buffers and forced-document semantics. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection on current main shows WhatsApp does not advertise or support Is this the best way to solve the issue? Yes. The latest diff keeps the lowering inside the WhatsApp plugin, reuses the existing WhatsApp send-media transport, and avoids the earlier core-specific branching called out in review. Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 125ebd09876f. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c1d556c92f
ℹ️ 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".
c1d556c to
0155f38
Compare
0155f38 to
ce65dd8
Compare
27f133d to
3b2ae9c
Compare
|
Merged via squash.
Thanks @ngutman! |
Summary
message(action="upload-file")calls with path/URL media into the existingsend+mediapath.Verification
node scripts/run-vitest.mjs extensions/whatsapp/src/channel-react-action.test.ts extensions/whatsapp/src/channel-actions.test.ts extensions/whatsapp/src/send.test.ts src/infra/outbound/message-action-runner.media.test.ts src/infra/outbound/message-action-params.test.tspnpm plugin-sdk:api:checkpnpm check:changed$codex-review: clean after accepted review fixesssh guti@100.65.30.41:~/projects/openclawatd043bd519e:pnpm openclaw message send --channel whatsapp --target +972523594699 --media /tmp/openclaw-wa-upload-test.md --force-document --message "PR 81883 source-build live upload test" --jsonreturned WhatsApp message id3EB09D321AFFE4F9F48473.message(action="upload-file", channel="whatsapp", filePath="/Users/guti/.openclaw/media/outbound/openclaw-wa-upload-test-source-build.md")returned WhatsApp message id3EB0A344E3B27AD4BE9460.Behavior addressed: A shared
messagetool call usingaction=upload-filewith a media path/URL no longer fails after resolving to WhatsApp; it is delivered through WhatsApp's supported send-media path while preserving scoped hydrated media and document semantics.Real environment tested: Local OpenClaw source checkout with targeted Vitest coverage and changed-file validation; remote source install running this branch at
d043bd519ewith a configured WhatsApp channel and running gateway service.Exact steps or command run after this patch:
node scripts/run-vitest.mjs extensions/whatsapp/src/channel-react-action.test.ts extensions/whatsapp/src/channel-actions.test.ts extensions/whatsapp/src/send.test.ts src/infra/outbound/message-action-runner.media.test.ts src/infra/outbound/message-action-params.test.ts;pnpm plugin-sdk:api:check;pnpm check:changed; fast-forward remote source checkout, rebuild viapnpm openclaw --version, then run direct WhatsApp CLI media send and a WhatsApp-bound agent prompt that calls the sharedmessagetool once withaction=upload-fileand a Markdown file under OpenClaw's managed media directory.Evidence after fix: Regression tests pass for WhatsApp upload-file path lowering, hydrated buffer reuse, explicit document media kind, and buffer size enforcement. The direct source-build WhatsApp send returned message id
3EB09D321AFFE4F9F48473; the agent/message-tool upload-file path returned tool result{ ok: true, channel: "whatsapp", action: "upload-file", messageId: "3EB0A344E3B27AD4BE9460" }.Observed result after fix: Focused tests report 5 passed files / 101 passed tests. The final code review pass reported no accepted/actionable findings. The configured WhatsApp chat receives the uploaded Markdown file from both the direct CLI send path and the agent
message(action="upload-file")path when the file is under an allowed OpenClaw media root.What was not tested: The live WhatsApp proof used managed local Markdown files rather than a direct base64 buffer payload. Buffer payload behavior is covered by focused tests, including WhatsApp media size-limit rejection.