Skip to content

fix(whatsapp): send voice replies as native audio attachments - #9687

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

fix(whatsapp): send voice replies as native audio attachments#9687
sqsge wants to merge 1 commit into
NousResearch:mainfrom
sqsge:codex/fix-whatsapp-send-voice-override

Conversation

@sqsge

@sqsge sqsge commented Apr 14, 2026

Copy link
Copy Markdown

Summary

This PR adds a WhatsApp-specific send_voice() override so voice replies are sent through the existing native media path instead of falling back to the base text placeholder behavior.

Why

The WhatsApp bridge already supports sending audio media payloads.

However, the Python WhatsApp adapter did not override send_voice(), so voice replies fell back to the base platform implementation, which sends a text placeholder like 🔊 Audio: <path> instead of a native media attachment.

This change stays intentionally narrow and wires the missing adapter method into the existing WhatsApp media-send path.

Changes

  • add a thin send_voice() override to WhatsAppAdapter
  • route voice replies through _send_media_to_bridge(chat_id, audio_path, "audio", caption)
  • add regression coverage to verify that send_voice() forwards the correct media type and caption

Fixes #9236

Testing

I added a regression test in tests/gateway/test_whatsapp_connect.py covering the adapter behavior directly.

In this local environment, the repository test suite for this file could not be run end-to-end because pytest-asyncio and some default pytest addopts dependencies are not installed here.

To reduce that risk, I verified the change with:

  • a direct Python-level smoke check confirming send_voice() forwards to the "audio" media path
  • a focused regression test covering the forwarding behavior and caption passthrough

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

WhatsApp adapter missing send_voice() override — voice messages sent as text path

3 participants