From 33c89e52ec3790394928d6be5dc869302028de63 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Sat, 28 Mar 2026 13:28:04 -0700 Subject: [PATCH] fix(whatsapp): add **kwargs to media sending methods to accept metadata (#3571) The base orchestrator passes metadata=_thread_metadata to send_image_file, send_video, and send_document. WhatsApp was the only platform adapter missing the parameter, causing TypeError crashes when sending media. Extended to all three methods (original PR only fixed send_image_file). Salvaged from PR #3144. Co-authored-by: afifai --- gateway/platforms/whatsapp.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gateway/platforms/whatsapp.py b/gateway/platforms/whatsapp.py index b83657401bd..3ab4b753358 100644 --- a/gateway/platforms/whatsapp.py +++ b/gateway/platforms/whatsapp.py @@ -526,6 +526,7 @@ class WhatsAppAdapter(BasePlatformAdapter): image_path: str, caption: Optional[str] = None, reply_to: Optional[str] = None, + **kwargs, ) -> SendResult: """Send a local image file natively via bridge.""" return await self._send_media_to_bridge(chat_id, image_path, "image", caption) @@ -536,6 +537,7 @@ class WhatsAppAdapter(BasePlatformAdapter): video_path: str, caption: Optional[str] = None, reply_to: Optional[str] = None, + **kwargs, ) -> SendResult: """Send a video natively via bridge — plays inline in WhatsApp.""" return await self._send_media_to_bridge(chat_id, video_path, "video", caption) @@ -547,6 +549,7 @@ class WhatsAppAdapter(BasePlatformAdapter): caption: Optional[str] = None, file_name: Optional[str] = None, reply_to: Optional[str] = None, + **kwargs, ) -> SendResult: """Send a document/file as a downloadable attachment via bridge.""" return await self._send_media_to_bridge(