Skip to content

fix(tts): include feishu in want_opus guard for native voice delivery - #45637

Closed
KeyArgo wants to merge 2 commits into
NousResearch:mainfrom
KeyArgo:work/issue-45557
Closed

fix(tts): include feishu in want_opus guard for native voice delivery#45637
KeyArgo wants to merge 2 commits into
NousResearch:mainfrom
KeyArgo:work/issue-45557

Conversation

@KeyArgo

@KeyArgo KeyArgo commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Problem

The want_opus guard at tools/tts_tool.py:1890 was:

want_opus = (platform == "telegram")

This gated opus conversion (for native voice-bubble delivery) to
Telegram only. minimax TTS outputs mp3, not ogg, so it needs
ffmpeg conversion to become voice-bubble compatible on Feishu.

Since v2026.6.5 (commit ed9087f, "fix(tts): keep native audio
outside Telegram voice delivery"), Feishu users with minimax TTS
were getting the mp3 sent as a file attachment instead of as a
voice bubble.

Fix

Extend the guard to include feishu alongside telegram:

want_opus = platform in {"telegram", "feishu"}

Behavior change

  • Telegram + minimax: still converts to opus (no change)
  • Feishu + minimax: NOW converts to opus (was: file attachment)
  • All other platforms: unchanged

Fixes #45557

The want_opus guard at tools/tts_tool.py:1890 was:
    want_opus = (platform == "telegram")

This gated opus conversion (for native voice-bubble delivery) to
Telegram only. minimax TTS outputs mp3, not ogg, so it needs
ffmpeg conversion to become voice-bubble compatible on Feishu.

Since v2026.6.5 (commit ed9087f), Feishu users with minimax TTS
were getting the mp3 sent as a file attachment instead of as a
voice bubble.

Fix: extend the guard to include feishu alongside telegram.
    want_opus = platform in {"telegram", "feishu"}

Fixes NousResearch#45557
@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery platform/feishu Feishu / Lark adapter tool/tts Text-to-speech and transcription P3 Low — cosmetic, nice to have duplicate This issue or pull request already exists labels Jun 13, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #45555 — same fix for #45557 (want_opus = platform in {telegram, feishu} in tts_tool.py so minimax mp3 converts to opus for Feishu voice bubbles). #45555 is the earlier-open PR. The combined alternative #37804 takes a broader approach.

Adds regression coverage for the feishu branch of the want_opus
guard fix. Mirrors the existing test_edge_telegram_converts_to_opus_voice
test but with HERMES_SESSION_PLATFORM=feishu.

This catches any future regression where feishu is removed from
the want_opus set or the conversion path stops applying to feishu.

Follows the pattern in tests/tools/test_tts_opus_routing.py.
@KeyArgo

KeyArgo commented Jun 13, 2026

Copy link
Copy Markdown
Contributor Author

Closing as duplicate of #45555 (Asanilo, opened 2026-06-13 11:24 UTC). The fix is identical. The test commit on branch will remain for the record.

@KeyArgo KeyArgo closed this Jun 13, 2026
LLQWQ pushed a commit to LLQWQ/hermes-agent that referenced this pull request Jun 26, 2026
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
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 duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have platform/feishu Feishu / Lark adapter 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.

minimax TTS on Feishu sends mp3 as file attachment instead of voice bubble

2 participants