Skip to content

fix: add missing send_voice() override to WhatsApp adapter - #6305

Closed
duan78 wants to merge 1 commit into
NousResearch:mainfrom
duan78:fix/whatsapp-send-voice
Closed

fix: add missing send_voice() override to WhatsApp adapter#6305
duan78 wants to merge 1 commit into
NousResearch:mainfrom
duan78:fix/whatsapp-send-voice

Conversation

@duan78

@duan78 duan78 commented Apr 8, 2026

Copy link
Copy Markdown

Summary

WhatsApp adapter (gateway/platforms/whatsapp.py) was missing a send_voice() override. All other media methods (send_image, send_image_file, send_video, send_document) were properly overridden to use _send_media_to_bridge(), but send_voice was missed.

This caused TTS audio files generated by the text_to_speech tool to be sent as plain text (e.g. 🔊 Audio: /path/to/file.ogg) instead of native WhatsApp voice notes.

Fix

Added send_voice() override following the exact same pattern as send_video():

async def send_voice(
    self,
    chat_id: str,
    audio_path: str,
    caption: Optional[str] = None,
    reply_to: Optional[str] = None,
    **kwargs,
) -> SendResult:
    """Send an audio file as a native WhatsApp voice message via bridge."""
    return await self._send_media_to_bridge(chat_id, audio_path, "audio", caption)

Related

Fixes #4979

WhatsApp adapter was missing a send_voice() override, causing TTS audio
files to be sent as plain text (e.g. "🔊 Audio: /path/to/file.ogg")
instead of native voice messages. All other media methods (send_image,
send_image_file, send_video, send_document) were already properly
overridden to use _send_media_to_bridge().

Fixes NousResearch#4979
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the fix! The same send_voice() override already landed on main in commit ed76185 ("feat(whatsapp): implement send_voice for audio message delivery") via #12656, so this PR is now a no-op diff against current main. Closing as superseded — the behavior you fixed is in main today.

ed76185

@teknium1 teknium1 closed this Apr 21, 2026
@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery platform/whatsapp WhatsApp Business adapter tool/tts Text-to-speech and transcription labels Apr 21, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #13002 — same WhatsApp send_voice() fix already merged.

@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #13002

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 platform/whatsapp WhatsApp Business adapter tool/tts Text-to-speech and transcription type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: WhatsApp adapter missing send_voice() override — voice messages sent as text

3 participants