fix(stt): accept .oga and .opus voice notes for transcription - #43371
Closed
eliemada wants to merge 1 commit into
Closed
fix(stt): accept .oga and .opus voice notes for transcription#43371eliemada wants to merge 1 commit into
eliemada wants to merge 1 commit into
Conversation
Telegram sends voice notes as .oga (OGG/Opus). SUPPORTED_FORMATS listed .ogg but not .oga, so transcribe_audio rejected every Telegram voice note with "Unsupported format: .oga" before reaching any STT backend. Add .oga and .opus to the allowlist, with a regression test.
teknium1
reviewed
Jul 14, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the focused regression test. Current main still rejects .opus in tools/transcription_tools.py:103, and Feishu can retain .opus when caching inbound audio (plugins/platforms/feishu/adapter.py:172,3925-3929).
Problems
- The reported Telegram path is no longer reproducible on current
main: inboundmsg.voiceis explicitly cached as.oggatplugins/platforms/telegram/adapter.py:7849-7853. - Please do not make
.ogaa bare shared allowlist entry without reconciling the current filename-normalization contract. WhatsApp maps Ogg/Opus MIME values to.oggbecause.ogais documented as downstream-STT-incompatible (gateway/platforms/whatsapp_cloud.py:129-164), while several cloud handlers upload the original basename (tools/transcription_tools.py:1406-1409,1479-1488,1566-1571).
Suggested changes
- Re-scope around the verified
.opusingress or canonicalize Ogg/Opus variants before remote dispatch. - Add a regression through the relevant cache-to-STT path, not only
_validate_audio_file().
Automated hermes-sweeper review.
|
|
||
| SUPPORTED_FORMATS = {".mp3", ".mp4", ".mpeg", ".mpga", ".m4a", ".wav", ".webm", ".ogg", ".aac", ".flac"} | ||
| SUPPORTED_FORMATS = {".mp3", ".mp4", ".mpeg", ".mpga", ".m4a", ".wav", ".webm", ".ogg", ".oga", ".opus", ".aac", ".flac"} | ||
| LOCAL_NATIVE_AUDIO_FORMATS = {".wav", ".aiff", ".aif"} |
Contributor
There was a problem hiding this comment.
Current Telegram inbound voice handling already forces .ogg (plugins/platforms/telegram/adapter.py:7849-7853), while WhatsApp deliberately maps .oga to .ogg because downstream STT expects that filename (gateway/platforms/whatsapp_cloud.py:129-164). Please establish provider-safe canonicalization before adding .oga to the shared allowlist; this change otherwise forwards the .oga basename unchanged to cloud providers.
This was referenced Jul 28, 2026
Contributor
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.
What does this PR do?
Telegram delivers voice notes as
.oga(OGG/Opus container).SUPPORTED_FORMATSintools/transcription_tools.pylisted.oggbut not.oga, sotranscribe_audio()rejected every inbound Telegram voice note withUnsupported format: .ogabefore it reached any STT backend. The gateway then replied "I couldn't transcribe your voice message."The check sits upstream of provider dispatch, so this broke voice notes for all backends (local faster-whisper, Groq, OpenAI, Mistral, xAI) and any command-provider. The fix adds
.ogaand.opusto the allowlist.Related Issue
No existing issue. Bug and reproduction below.
Type of Change
Changes Made
tools/transcription_tools.py: add.ogaand.opustoSUPPORTED_FORMATS.tests/tools/test_transcription_tools.py: addtest_telegram_oga_and_opus_acceptedregression test.How to Test
Reproduce (before the fix): send a voice note to a Telegram gateway, or call
transcribe_audio("voice.oga")— it returns{"success": false, "error": "Unsupported format: .oga ..."}.After the fix:
_validate_audio_file()now returnsNone(accepted) for.ogaand.opus. Verified end to end on Ubuntu 24.04 with a real Telegram voice note routed to a command-provider STT backend.Checklist
Code
pytest tests/tools/test_transcription_tools.py -qand all 108 tests passDocumentation & Housekeeping