Skip to content

fix(whatsapp): propagate quotedMessageId to reply_to_id - #52856

Closed
dhruvkej9 wants to merge 1 commit into
NousResearch:mainfrom
dhruvkej9:fix-whatsapp-reply-to-id
Closed

fix(whatsapp): propagate quotedMessageId to reply_to_id#52856
dhruvkej9 wants to merge 1 commit into
NousResearch:mainfrom
dhruvkej9:fix-whatsapp-reply-to-id

Conversation

@dhruvkej9

Copy link
Copy Markdown
Contributor

The Baileys bridge already reports quotedMessageId for reply messages, but the WhatsApp plugin adapter ignored it and never set MessageEvent.reply_to_id. This caused inbound WhatsApp replies to look like top-level messages in the agent context and broke reply-threading in both DMs and groups.

Changes:

  • Map data['quotedMessageId'] to reply_to_id when building a MessageEvent from the bridge payload.

Tested locally: WhatsApp replies now carry the original message id and the agent sees the reply context correctly.

The Baileys bridge already reports quotedMessageId for replies, but the
WhatsApp plugin adapter ignored it and never set MessageEvent.reply_to_id.
This caused inbound replies to look like top-level messages in the agent
context and broke reply-threading in groups/DMs.

Refs: observed in local gateway logs where reply_to_id was always None
for WhatsApp replies.
@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery platform/whatsapp WhatsApp Business adapter P3 Low — cosmetic, nice to have labels Jun 26, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.
Related: #16552 and #28878 (same quotedMessageId -> reply_to_id reply-context fix) target gateway/platforms/whatsapp.py, but the WhatsApp adapter has since been relocated to plugins/platforms/whatsapp/adapter.py (the path this PR edits) and the old path no longer exists on main. This PR is the version implementable against current main; the earlier PRs target a stale location. Flagging for a maintainer to pick which target survives.

@dhruvkej9

Copy link
Copy Markdown
Contributor Author

Closing in favor of #52875 which includes this fix plus the full quoted context (text/media paths) for human-like replies.

@dhruvkej9 dhruvkej9 closed this Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have platform/whatsapp WhatsApp Business adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants