Skip to content

fix: send WhatsApp TTS as native audio - #9899

Closed
noestelar wants to merge 1 commit into
NousResearch:mainfrom
noestelar:fix/whatsapp-native-voice
Closed

fix: send WhatsApp TTS as native audio#9899
noestelar wants to merge 1 commit into
NousResearch:mainfrom
noestelar:fix/whatsapp-native-voice

Conversation

@noestelar

Copy link
Copy Markdown

Summary

  • add a WhatsApp-specific send_voice() implementation
  • route voice replies through _send_media_to_bridge(..., "audio", ...)
  • add regression tests so WhatsApp audio is uploaded as native media instead of sending the file path as text

Test Plan

  • source venv/bin/activate && python -m pytest tests/gateway/test_whatsapp_voice.py -q

Notes

  • I also re-ran the broader WhatsApp gateway subset earlier during validation.
  • With the live gateway running, some connect tests can fail locally because the adapter detects the active WhatsApp session lock.

Copilot AI review requested due to automatic review settings April 14, 2026 22:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes WhatsApp TTS/voice delivery by adding a WhatsApp-specific send_voice() implementation that uploads audio through the WhatsApp bridge as native media (instead of falling back to the base adapter behavior of sending the local file path as text).

Changes:

  • Added WhatsAppAdapter.send_voice() to route audio through _send_media_to_bridge(..., "audio", ...).
  • Added regression tests asserting that WhatsApp voice sends hit the bridge /send-media endpoint with mediaType="audio" and carry captions through the adapter payload.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
gateway/platforms/whatsapp.py Adds a WhatsApp-specific send_voice() that uses the bridge native media upload path.
tests/gateway/test_whatsapp_voice.py New regression tests verifying bridge payload and endpoint usage for native audio sends.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@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.

4 participants