fix(feishu): native voice bubble support for TTS audio messages - #53157
Closed
LLQWQ wants to merge 3 commits into
Closed
fix(feishu): native voice bubble support for TTS audio messages#53157LLQWQ wants to merge 3 commits into
LLQWQ wants to merge 3 commits into
Conversation
Three changes to enable native Feishu voice bubbles instead of file attachments: 1. tools/tts_tool.py: Add 'feishu' to want_opus guard so TTS generates .ogg (opus) format for Feishu, matching the existing Telegram behavior. Related: NousResearch#45637 2. plugins/platforms/feishu/adapter.py - upload duration: Include audio duration in CreateFileRequestBody when uploading opus files. Duration is extracted by parsing the OGG container (pure Python, no ffprobe dependency). 3. plugins/platforms/feishu/adapter.py - thread routing fallback: Feishu's create message API rejects msg_type='audio' with receive_id_type='thread_id' (error 99992402). As a workaround, when audio send fails in a thread: a) Try the reply API by fetching the last message in the thread b) Fall back to chat_id routing (main chat) if reply also fails Fixes NousResearch#18831 Fixes NousResearch#16524
Contributor
|
Thanks for tracing this through both TTS generation and the Feishu media pipeline. The first two gaps remain on current main: Problems
Suggested changes
This is an automated hermes-sweeper review. |
teknium1
pushed a commit
that referenced
this pull request
Jul 28, 2026
…bubbles Salvaged from PR #53157 (@LLQWQ). Three changes for native Feishu voice bubble delivery: 1. Include audio duration in the file-upload body when uploading opus files — Feishu renders 0:00 bubbles without it. Duration is extracted by parsing the OGG container's last granule position (pure Python, no ffprobe dependency). 2. Thread routing fallback: Feishu's create-message API rejects msg_type='audio' with receive_id_type='thread_id' (error 99992402); retry via the reply API against the thread's last message, then fall back to chat_id routing. 3. (dropped) tools/tts_tool.py want_opus hunk — superseded by main's OPUS_VOICE_PLATFORMS, which already includes feishu. The PR's stray scripts/release.py hunk was also dropped (frozen AUTHOR_MAP policy; mapping added under contributors/emails/ instead). Fixes #45557 Refs #18831 #16524
teknium1
pushed a commit
that referenced
this pull request
Jul 28, 2026
…bubbles Salvaged from PR #53157 (@LLQWQ). Three changes for native Feishu voice bubble delivery: 1. Include audio duration in the file-upload body when uploading opus files — Feishu renders 0:00 bubbles without it. Duration is extracted by parsing the OGG container's last granule position (pure Python, no ffprobe dependency). 2. Thread routing fallback: Feishu's create-message API rejects msg_type='audio' with receive_id_type='thread_id' (error 99992402); retry via the reply API against the thread's last message, then fall back to chat_id routing. 3. (dropped) tools/tts_tool.py want_opus hunk — superseded by main's OPUS_VOICE_PLATFORMS, which already includes feishu. The PR's stray scripts/release.py hunk was also dropped (frozen AUTHOR_MAP policy; mapping added under contributors/emails/ instead). Fixes #45557 Refs #18831 #16524
Contributor
|
Merged into main via consolidated salvage PR #73508 (merge Your contribution is credited to you in git history. Thank you! Closing this PR as merged-via-salvage. |
randlee
pushed a commit
to randlee/hermes-agent
that referenced
this pull request
Aug 11, 2026
…bubbles Salvaged from PR NousResearch#53157 (@LLQWQ). Three changes for native Feishu voice bubble delivery: 1. Include audio duration in the file-upload body when uploading opus files — Feishu renders 0:00 bubbles without it. Duration is extracted by parsing the OGG container's last granule position (pure Python, no ffprobe dependency). 2. Thread routing fallback: Feishu's create-message API rejects msg_type='audio' with receive_id_type='thread_id' (error 99992402); retry via the reply API against the thread's last message, then fall back to chat_id routing. 3. (dropped) tools/tts_tool.py want_opus hunk — superseded by main's OPUS_VOICE_PLATFORMS, which already includes feishu. The PR's stray scripts/release.py hunk was also dropped (frozen AUTHOR_MAP policy; mapping added under contributors/emails/ instead). Fixes NousResearch#45557 Refs NousResearch#18831 NousResearch#16524
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.
Problem
Feishu users receive TTS audio as file attachments instead of native voice bubbles. Three issues prevent native voice delivery:
want_opusguard intts_tool.pyonly includes Telegramdurationfor opus audiomsg_type='audio'withreceive_id_type='thread_id'returns error 99992402Related: #18831, #16524, #45637
Changes
1.
tools/tts_tool.py— opus format for FeishuAdd
"feishu"to thewant_opusguard so TTS generates.ogg(opus) format for Feishu, matching the existing Telegram behavior.2.
plugins/platforms/feishu/adapter.py— upload with durationAdd
_get_audio_duration_ms()that parses the OGG container (pure Python, no ffprobe dependency) and passdurationtoCreateFileRequestBodywhen uploading opus files.3.
plugins/platforms/feishu/adapter.py— thread routing fallbackWhen audio send fails with 99992402 in a thread:
im/v1/message.listchat_idrouting (main chat) if reply also failsTesting
Verified on Feishu DM with threads:
Notes
struct, no external dependenciesreceive_id_type='thread_id'formsg_type='audio'