fix(#41407): recognize WhatsApp JID formats (groups, DMs, LIDs) - #41415
Closed
iamlukethedev wants to merge 1 commit into
Closed
fix(#41407): recognize WhatsApp JID formats (groups, DMs, LIDs)#41415iamlukethedev wants to merge 1 commit into
iamlukethedev wants to merge 1 commit into
Conversation
… LIDs) Fixes two related bugs in send_message_tool._parse_target_ref: 1. Suffixed JIDs (@g.us, @s.whatsapp.net, @lid) fall through silently to home channel 2. Bare digits crash the bridge with 'Cannot destructure property user' error Solution: Add WhatsApp-specific parsing logic that: - Recognizes suffixed JIDs (@g.us groups, @s.whatsapp.net DMs, @lid LIDs) - Auto-classifies bare digits by length: - 17+ digits → @g.us (group ID) - 7-15 digits → @s.whatsapp.net (phone number) All WhatsApp JID formats now parse correctly. Fixes NousResearch#41407
tonydwb
approved these changes
Jun 7, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Reviewed PR #41415: fix(#41407): recognize WhatsApp JID formats (groups, DMs, LIDs)
✅ Approve
- Extends JID parsing to cover more WhatsApp messaging surface without changing integer-coded constants.
- One-task delivery keeps regression risk low in relation to chat-routing logic.
Reviewed in batch on 2026-06-08
Contributor
|
Thanks for the focused WhatsApp routing fix. This is already implemented on current
Closing as implemented on main. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two related bugs in send_message_tool._parse_target_ref:
<digits>@g.us(group),<digits>@s.whatsapp.net(DM),<digits>@lid(LID) aren't recognized, causing silent fallback to home channel120363022690908060are passed to Baileys, which crashes with 'Cannot destructure property user' errorSolution
Add WhatsApp-specific parsing in _parse_target_ref():
Testing
Fixes #41407