fix(feishu): map audio messages to VOICE for STT transcription (#30822) - #30829
fix(feishu): map audio messages to VOICE for STT transcription (#30822)#30829Linux2010 wants to merge 1 commit into
Conversation
|
Hermes autonomous autofix diagnosed the failing Contributor Attribution Check. Cause: I do not have push permission to Local verification passed:
|
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused Feishu STT fix. The underlying issue remains present on current main: native Feishu audio resolves to MessageType.AUDIO in plugins/platforms/feishu/adapter.py:3802-3824, while gateway/run.py:10414-10458 sends AUDIO to the attachment-only path and VOICE through transcription.
Problems
- The PR edits
gateway/platforms/feishu.py, but that file was deleted when commit476d8d9ccmoved the active adapter toplugins/platforms/feishu/adapter.py. The production edits need to be ported to the active adapter. - The new test imports
gateway.platforms.feishu.FeishuAdapter; current Feishu tests importplugins.platforms.feishu.adapter.FeishuAdapter(for exampletests/gateway/test_feishu.py:1477).
Suggested changes
- Salvage the four mapping/batching/extraction edits into
plugins/platforms/feishu/adapter.py:3321-3325,:3760-3765, and:3802-3824, and update the test import to the plugin path.
Automated hermes-sweeper review.
| @@ -3519,7 +3519,7 @@ def _resolve_media_message_type(media_type: str, *, default: MessageType) -> Mes | |||
| if normalized.startswith("image/"): | |||
There was a problem hiding this comment.
Current main deleted this adapter path in 476d8d9cc; port this resolver change (and the related batching/extraction edits) to plugins/platforms/feishu/adapter.py, the active Feishu implementation.
…esearch#30822) Feishu voice messages (Opus/OGG) were classified as MessageType.AUDIO, which after the Telegram audio/voice split is treated as a file attachment and skips STT transcription. Since Feishu has no separate VOICE message type, all audio should map to VOICE so it goes through the STT pipeline. Fix: change _resolve_media_message_type and _resolve_normalized_message_type to return MessageType.VOICE instead of MessageType.AUDIO for audio media. Also update _should_batch_media_event and text extraction check to include MessageType.VOICE instead of AUDIO. Test: update test_extract_audio_message_downloads_and_caches to expect VOICE, and add test_audio_message_maps_to_voice_for_stt as a regression test for NousResearch#30822.
e3cc8d3 to
1846db3
Compare
What broke
Feishu voice messages (Opus/OGG) are classified as
MessageType.AUDIO. After the Telegram audio/voice split,MessageType.AUDIOis treated as a file attachment and skips STT transcription entirely. Since Feishu has no separateVOICEmessage type, all voice messages end up being silently dropped from the STT pipeline, breaking auto-transcription for Feishu users.Root cause
The Feishu adapter maps audio messages to
MessageType.AUDIOvia_resolve_media_message_type()and_resolve_normalized_message_type(). This was correct before the Telegram AUDIO/VOICE split, but now AUDIO means "file attachment" (no STT) while VOICE means "voice message" (goes through STT).Why this fix is minimal
Changes four call sites in
gateway/platforms/feishu.pyfromMessageType.AUDIOtoMessageType.VOICE:_resolve_media_message_type()— audio/* media type mapping_resolve_normalized_message_type()— preferred="audio" resolution_should_batch_media_event()— media batching check_extract_message_content()— text extraction candidate checkNo changes to other platform adapters or the core STT pipeline.
What I tested
test_extract_audio_message_downloads_and_cachesto expectVOICEinstead ofAUDIOtest_audio_message_maps_to_voice_for_sttas a regression test for Feishu voice messages incorrectly classified as AUDIO (file attachment), skipping STT transcription #30822What I intentionally did not change