fix: Feishu voice messages routed to VOICE for STT; .ogg added to nat… - #38299
fix: Feishu voice messages routed to VOICE for STT; .ogg added to nat…#38299bujinyun wants to merge 1 commit into
Conversation
…ive audio formats
teknium1
left a comment
There was a problem hiding this comment.
Thanks for identifying the Feishu STT routing gap. Current main confirms the core issue: plugins/platforms/feishu/adapter.py:3822 resolves normalized audio as AUDIO, and gateway/run.py:10416-10422 excludes that type from STT.
Problems
- The proposed unconditional
VOICEmapping loses the existing audio-file distinction.gateway/run.py:10414-10422explicitly treatsAUDIOattachments as non-STT, and the Feishu adapter sends audio as a file attachment atplugins/platforms/feishu/adapter.py:2158-2175. - The diff also adds
.silkandpilkwork outside the stated scope. Adding.silkto global validation affects every provider (tools/transcription_tools.py:1022-1036), while only the local path converts it. - No regression tests cover Feishu audio-vs-voice classification or local OGG preparation.
Suggested changes
- Port the fix to
plugins/platforms/feishu/adapter.pyand classify only verified voice-note inputs asVOICE; retainAUDIOfor file attachments. - Add resolver/STT-path tests for both cases, plus an OGG local-STT regression test.
- Split or complete the separate SILK support.
Automated hermes-sweeper review.
| return self._resolve_media_message_type(media_types[0] if media_types else "", default=MessageType.PHOTO) | ||
| if preferred == "audio": | ||
| return self._resolve_media_message_type(media_types[0] if media_types else "", default=MessageType.AUDIO) | ||
| return MessageType.VOICE |
There was a problem hiding this comment.
Please retain a discriminator here rather than classifying every Feishu audio event as VOICE: current gateway routing deliberately keeps MessageType.AUDIO attachments out of STT (gateway/run.py:10414-10422). This needs coverage for both a native voice note and an ordinary audio-file attachment.
| SUPPORTED_FORMATS = {".mp3", ".mp4", ".mpeg", ".mpga", ".m4a", ".wav", ".webm", ".ogg", ".aac", ".flac"} | ||
| LOCAL_NATIVE_AUDIO_FORMATS = {".wav", ".aiff", ".aif"} | ||
| SUPPORTED_FORMATS = {".mp3", ".mp4", ".mpeg", ".mpga", ".m4a", ".wav", ".webm", ".ogg", ".aac", ".flac", ".silk"} | ||
| LOCAL_NATIVE_AUDIO_FORMATS = {".wav", ".aiff", ".aif", ".ogg"} |
There was a problem hiding this comment.
Adding .silk to this global validation set affects cloud-provider dispatch too, but the new conversion exists only in _transcribe_local. Please split this unrelated capability or normalize it consistently for every provider that can receive an accepted .silk file.
|
Closing as stale target: this PR patches The Feishu VOICE-routing half is covered by the #29235 salvage against the live plugin adapter, and the Thanks @bujinyun — if anything in your change isn't covered by the salvage noted above, please resubmit against the current plugin adapter. |
What does this PR do?
Fixes Feishu voice messages not being auto-transcribed by the STT pipeline. Two changes:
feishu.py: Feishu's audio message type was mapped to MessageType.AUDIO (audio file attachment), which skips STT transcription. In Feishu's API, audio IS a voice message - there is no "audio file attachment" concept (files use file type). Changed to MessageType.VOICE so voice messages trigger auto-transcription.
transcription_tools.py: Added .ogg to LOCAL_NATIVE_AUDIO_FORMATS. Feishu sends voice as .ogg, which faster-whisper supports natively, but the format was missing from the native list, causing unnecessary ffmpeg dependency.
Type of Change
Changes Made
How to Test