Skip to content

fix(feishu): map audio messages to VOICE for STT transcription (#30822) - #30829

Closed
Linux2010 wants to merge 1 commit into
NousResearch:mainfrom
Linux2010:fix/feishu-audio-to-voice-stt-30822
Closed

fix(feishu): map audio messages to VOICE for STT transcription (#30822)#30829
Linux2010 wants to merge 1 commit into
NousResearch:mainfrom
Linux2010:fix/feishu-audio-to-voice-stt-30822

Conversation

@Linux2010

Copy link
Copy Markdown
Contributor

What broke

Feishu voice messages (Opus/OGG) are classified as MessageType.AUDIO. After the Telegram audio/voice split, MessageType.AUDIO is treated as a file attachment and skips STT transcription entirely. Since Feishu has no separate VOICE message 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.AUDIO via _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.py from MessageType.AUDIO to MessageType.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 check

No changes to other platform adapters or the core STT pipeline.

What I tested

What I intentionally did not change

  • Telegram AUDIO/VOICE handling
  • Core STT pipeline logic
  • Other platform adapters (Mattermost, WhatsApp, etc.)

@MKI13

MKI13 commented May 23, 2026

Copy link
Copy Markdown

Hermes autonomous autofix diagnosed the failing Contributor Attribution Check.

Cause: linux2010@github.com (Linux2010) is missing from scripts/release.py AUTHOR_MAP.

I do not have push permission to Linux2010/hermes-agent, so I pushed the one-line fix to MKI13:autofix/pr-30829-author-map and opened a PR against your fork branch:
Linux2010#3

Local verification passed:

  • python -m py_compile scripts/release.py
  • Contributor attribution check reproduced locally: all contributor emails are mapped.

@alt-glitch alt-glitch added type/bug Something isn't working platform/feishu Feishu / Lark adapter comp/gateway Gateway runner, session dispatch, delivery tool/tts Text-to-speech and transcription P2 Medium — degraded but workaround exists labels May 23, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #29235, which makes the same Feishu AUDIO→VOICE mapping change. See also #29295 and #30174 (both already flagged as duplicates of #29235). Fixes #30822, which is itself a duplicate report of the same bug.

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

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 commit 476d8d9cc moved the active adapter to plugins/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 import plugins.platforms.feishu.adapter.FeishuAdapter (for example tests/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/"):

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.

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.

@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 13, 2026
…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.
@teknium1

Copy link
Copy Markdown
Contributor

The Feishu native-voice classification fix landed in #73515 via @wuli666's #29235 (earliest). Thanks for identifying the same gap!

(Landed via #73515, merge c911a5f10f.) Closing.

@teknium1 teknium1 closed this Jul 29, 2026
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 P2 Medium — degraded but workaround exists platform/feishu Feishu / Lark adapter sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages 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