feat: add WhatsApp quote and status primitives#21977
Conversation
828e39d to
16cfe6e
Compare
austinpickett
left a comment
There was a problem hiding this comment.
Please fix merge conflicts and use .github/PULL_REQUEST_TEMPLATE.md
16cfe6e to
88322e2
Compare
|
@austinpickett — rebased on current |
88322e2 to
f59a700
Compare
|
@austinpickett — rebased onto current Same 2-commit scope as before:
Locally validated on the rebased tip: Ready for re-review whenever you have a moment. Happy to address anything else. |
|
Rebased onto current Locally tested: The earlier review feedback (merge-conflict fix + PR template) has been |
234cc04 to
28a2131
Compare
|
Rebased onto current Locally tested: |
|
@austinpickett both points from your review should be addressed now:
Would appreciate a re-review when you have a moment. Thanks! |
|
Rebased onto current Locally tested:
|
50425a9 to
1a4a4aa
Compare
|
Rebased onto current |
|
Rebased onto current Same scope as before — no behavioral changes vs the prior tip. Clean Locally tested: whatsapp-formatting + whatsapp-group-gating + |
1a4a4aa to
9255371
Compare
What does this PR do?
Adds WhatsApp quote/reaction/status primitives that Baileys supports natively but Hermes was paving over with plain-text follow-ups.
quotedMessageId,quotedText,quotedRemoteJid) into HermesMessageEventreply context./send-mediaand adds bridge primitives for message reactions, private status replies, status reactions, and explicit-recipient text status posts.platforms.whatsapp.extra.statuses.enabled: trueandingest: true.whatsapp_action, a WhatsApp-specific messaging tool for owner/user-requested advanced actions:react_message,status_reply,status_react, andpost_text_status.Design notes
send_message; this keeps WhatsApp-specific semantics explicit.whatsapp_actionincludesdry_run=trueso agents can inspect the exact bridge endpoint/payload before performing external side effects.status_jid_list; there is intentionally no "all contacts" fallback.replyTois not in the bridge cache, the bridge sends the message without a quote and reportsquoted: false.node:testcan import helper functions without starting an HTTP server or socket.Operational follow-up after merge
Related Issue
No related issue — surfaced from production WhatsApp use where plain-text "@reply" fallbacks felt wrong vs the platform's native quote/reaction UX.
Fixes #
Type of Change
Changes Made
scripts/whatsapp-bridge/bridge.js— WAMessage cache; new/send-media-reply,/react,/status-reply,/status-react,/post-text-statusendpoints; side-effect-light import surface for tests.scripts/whatsapp-bridge/bridge.test.mjs— Node test suite for the new primitives.gateway/platforms/whatsapp.py— quote metadata propagation; adapter methods for reactions/status/replies.tools/whatsapp_action_tool.py— newwhatsapp_actiontool:react_message,status_reply,status_react,post_text_status, withdry_run.tests/tools/test_whatsapp_action_tool.py,tests/gateway/test_whatsapp_*.py— coverage for tool + adapter wiring.How to Test
./venv/bin/python -m pytest tests/tools/test_whatsapp_action_tool.py tests/gateway/test_whatsapp_*.py tests/gateway/test_platform_base.py -q— 188 passing on current rebase.
cd scripts/whatsapp-bridge && npm test -- --test-reporter=specfor the Node bridge primitives.node --check scripts/whatsapp-bridge/bridge.jsand./venv/bin/python -m py_compile tools/whatsapp_action_tool.py gateway/platforms/whatsapp.pyfor syntax sanity.whatsapp_actiontool withdry_run=truefirst to inspect the bridge payload, then run withdry_run=falseagainst a paired WhatsApp session.Checklist
origin/main(2026-05-25; one trivial conflict inwhatsapp.pywas an additive merge — kept upstream's new pre-flight pairing check plus this PR's bridge-found log line)gateway/platforms/*adapters andtools/*modulesNotes for reviewers
whatsapp_actionis a new tool,whatsapp.pyadditions are backward compatible (existing callers see the same methods plus new optional ones).enabled+ingest) precisely because Baileys status support is fragile and shouldn't fail-open into surprise behavior.