Skip to content

Add configurable WhatsApp inbound read receipts - #70340

Closed
maff-t2b wants to merge 2 commits into
NousResearch:mainfrom
maff-t2b:maff/whatsapp-read-receipts-20260723
Closed

Add configurable WhatsApp inbound read receipts#70340
maff-t2b wants to merge 2 commits into
NousResearch:mainfrom
maff-t2b:maff/whatsapp-read-receipts-20260723

Conversation

@maff-t2b

@maff-t2b maff-t2b commented Jul 23, 2026

Copy link
Copy Markdown

Summary

  • add a send_read_receipts WhatsApp config setting
  • pass it through the platform adapter to the bridge
  • mark only policy-accepted inbound messages as read, after DM/group/mention filtering
  • preserve original WhatsApp group message keys
  • restart a reused bridge when the configured read-receipt value changes
  • expose the active setting through bridge health
  • add Python and native bridge regression coverage

Test plan

  • pytest -q -o addopts= tests/gateway/test_whatsapp_connect.py tests/gateway/test_whatsapp_reply_prefix.py tests/gateway/test_whatsapp_stale_bridge.py (54 passed)
  • node --test scripts/whatsapp-bridge/bridge.native.test.mjs (passed)
  • Python compilation, Node syntax checks, and git diff --check passed

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery comp/plugins Plugin system and bundled plugins platform/whatsapp WhatsApp Business adapter area/config Config system, migrations, profiles sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades duplicate This issue or pull request already exists labels Jul 23, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of #8690: this implements the same Baileys inbound readMessages mechanism for WhatsApp read receipts. The opt-in configuration is a scope variant within the existing read-receipt cluster.

kshitijk4poor added a commit that referenced this pull request Jul 28, 2026
Needed for PR #70340 attribution check.
kshitijk4poor added a commit that referenced this pull request Jul 28, 2026
- Change await self._send_read_receipt to asyncio.create_task to avoid
  blocking message dispatch on slow bridge responses (matches BlueBubbles
  pattern). Up to 5s per-message latency eliminated.
- Update tests: assert_called_once_with instead of assert_awaited_once_with
  since the receipt is now scheduled, not directly awaited.
- Add send_read_receipts documentation to whatsapp.md following the
  BlueBubbles docs pattern.
@kshitijk4poor

Copy link
Copy Markdown
Collaborator

Merged via #73322 — your commits cherry-picked with authorship preserved (rebase-merge).

Your implementation was the strongest of 4 competing PRs for this feature. We made three follow-up changes on top:

  1. Changed await self._send_read_receipt() to asyncio.create_task() (fire-and-forget) to avoid blocking message dispatch — matches the BlueBubbles adapter pattern
  2. Updated test assertions from assert_awaited to assert_called for the fire-and-forget pattern
  3. Added send_read_receipts documentation to website/docs/user-guide/messaging/whatsapp.md

Thanks for the clean implementation!

randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
…age)

- Change await self._send_read_receipt to asyncio.create_task to avoid
  blocking message dispatch on slow bridge responses (matches BlueBubbles
  pattern). Up to 5s per-message latency eliminated.
- Update tests: assert_called_once_with instead of assert_awaited_once_with
  since the receipt is now scheduled, not directly awaited.
- Add send_read_receipts documentation to whatsapp.md following the
  BlueBubbles docs pattern.
33hodl pushed a commit to 33hodl/hermes-agent that referenced this pull request Aug 12, 2026
33hodl pushed a commit to 33hodl/hermes-agent that referenced this pull request Aug 12, 2026
…age)

- Change await self._send_read_receipt to asyncio.create_task to avoid
  blocking message dispatch on slow bridge responses (matches BlueBubbles
  pattern). Up to 5s per-message latency eliminated.
- Update tests: assert_called_once_with instead of assert_awaited_once_with
  since the receipt is now scheduled, not directly awaited.
- Add send_read_receipts documentation to whatsapp.md following the
  BlueBubbles docs pattern.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/gateway Gateway runner, session dispatch, delivery comp/plugins Plugin system and bundled plugins duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have platform/whatsapp WhatsApp Business adapter sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants