fix(whatsapp): normalize bare phone numbers to full JID for outgoing sends (#41660) - #41866
Closed
Elshayib wants to merge 2 commits into
Closed
fix(whatsapp): normalize bare phone numbers to full JID for outgoing sends (#41660)#41866Elshayib wants to merge 2 commits into
Elshayib wants to merge 2 commits into
Conversation
added 2 commits
June 8, 2026 05:54
The title generation path hardcoded a 30s timeout, ignoring the
auxiliary.title_generation.timeout config value. Thread the timeout
parameter through maybe_auto_title -> auto_title_session ->
generate_title, and read the config value in gateway/run.py via
_get_task_timeout('title_generation') so user-configured values
(e.g. 300s for slow local models) are respected.
Fixes #41812
…sends When sending WhatsApp messages via phone number targets, bare numbers (e.g. 15005004144) were passed directly to the bridge, causing jidDecode to fail with 'Cannot destructure property user'. The _normalize_whatsapp_id() method existed for incoming messages but was never applied to outgoing sends. Add _normalize_outgoing_chat_id() that appends @s.whatsapp.net to bare phone numbers (digits with optional + prefix) and apply it in send(), _send_media_to_bridge(), and send_typing(). Full JIDs and group IDs pass through unchanged. 8 new tests cover the normalization logic. Fixes #41660
Contributor
Author
|
CI failure is a pre-existing infrastructure flake — |
Contributor
|
Fixed on main via #50379 (salvage of #8639) — bare WhatsApp phone targets are now normalized to @sgaofen's #8639 was the earliest of this cluster, so it was used as the base and credited first; thanks @Elshayib for independently catching and fixing the same bug. Closing as duplicate. |
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
WhatsApp send fails with
jidDecode(...)error when using bare phone numbers (e.g.15005004144) as targets. The bridge expects full JIDs (15005004144@s.whatsapp.net).Root Cause
_normalize_whatsapp_id()existed for normalizing incoming message IDs but was never applied to outgoingchat_idvalues insend(),_send_media_to_bridge(), orsend_typing().Changes
gateway/platforms/whatsapp.py: Added_normalize_outgoing_chat_id()static method that appends@s.whatsapp.netto bare phone numbers (digits with optional+prefix). Full JIDs and group IDs pass through unchanged. Applied in all three outgoing methods.tests/gateway/test_whatsapp_normalize_chat_id.py: 8 new tests covering bare numbers,+prefix, full JIDs, group IDs, empty strings, whitespace, and group IDs with dashes.Validation
Fixes #41660