Skip to content

whatsapp: fix group reply trigger via canonical JID normalization#11469

Closed
RiptideV wants to merge 1 commit into
NousResearch:mainfrom
RiptideV:fix/whatsapp-reply-jid-normalize
Closed

whatsapp: fix group reply trigger via canonical JID normalization#11469
RiptideV wants to merge 1 commit into
NousResearch:mainfrom
RiptideV:fix/whatsapp-reply-jid-normalize

Conversation

@RiptideV

Copy link
Copy Markdown

Summary

  • canonicalize device-suffixed WhatsApp JIDs in gateway adapter
  • canonicalize same JID format in WhatsApp bridge before emitting events
  • preserve parsed debug event logging for verification

Root cause

Baileys emits bot IDs with device suffixes while reply participant can arrive without suffix, so equality checks failed and group reply-to-bot did not trigger.

Validation

  • parsed event now normalizes IDs consistently
  • reply to Hermes message in WhatsApp group now triggers response

Files

  • gateway/platforms/whatsapp.py
  • scripts/whatsapp-bridge/bridge.js

@RiptideV RiptideV force-pushed the fix/whatsapp-reply-jid-normalize branch from 904fb3e to 240008b Compare April 17, 2026 07:37
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery platform/whatsapp WhatsApp Business adapter labels Apr 24, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the fix, @RiptideV! This JID normalization is a real bug and the root-cause analysis is correct.

However, this automated hermes-sweeper review found that the exact fix — normalizeWhatsAppId() in bridge.js and _normalize_whatsapp_id() + _message_is_reply_to_bot() in gateway/platforms/whatsapp.py — was already merged to main in commit 714e4941b (2026-04-03), about two weeks before this PR was opened.

  • gateway/platforms/whatsapp.py line 264: _normalize_whatsapp_id() strips device suffixes via ':' → '@' replacement, called from _message_is_reply_to_bot() at line 281
  • scripts/whatsapp-bridge/bridge.js line 65: normalizeWhatsAppId() with identical logic, applied to quotedParticipant and botIds before the event is emitted

The upstream commit that introduced this fix is 714e4941b. Closing as already implemented on main.

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 P2 Medium — degraded but workaround exists platform/whatsapp WhatsApp Business adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants