#15351: feat(feishu): Add native audio message support (voice bubble)
channel: feishu
stale
size: S
Cluster:
Feishu Streaming Enhancements
## Summary
Add support for sending native voice messages (audio bubbles) in Feishu instead of file attachments.
## Problem
Currently, when sending audio files via the Feishu plugin, they are sent as file attachments (`msg_type: "file"` or `msg_type: "media"`) instead of native voice messages (`msg_type: "audio"`). This results in a poor user experience as users see a file download link instead of a playable voice bubble with duration indicator.
## Solution
1. **Add `sendAudioFeishu` function**: A new function that sends audio messages using `msg_type: "audio"`, which displays as a native voice bubble in Feishu client.
2. **Modify `sendMediaFeishu`**: Updated to detect audio files (`.opus`, `.ogg`) and route them to `sendAudioFeishu` instead of `sendFileFeishu`.
3. **Separate media type handling**:
- Audio files (`.opus`, `.ogg`) → `msg_type: "audio"` (voice bubble)
- Video files (`.mp4`, `.mov`, `.avi`) → `msg_type: "media"` (video player)
- Other files → `msg_type: "file"` (file attachment)
## Testing
Tested with:
- Edge TTS generated audio converted to opus format
- Various audio lengths (3s to 68s)
- Successfully displays as native voice bubble in Feishu client (desktop and mobile)
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR adds a dedicated `sendAudioFeishu` path that sends Feishu `msg_type: "audio"` messages (voice bubble UI) and updates `sendMediaFeishu` to route `.opus`/`.ogg` through this audio path, while routing common video extensions through `msg_type: "media"` and leaving other files as `msg_type: "file"`.
The change fits the existing media module pattern: upload via `im.file.create` / `im.image.create`, then send via `im.message.create` (or `reply`) using the returned key. The new logic mainly affects how audio is uploaded/sent and removes the prior `fileType === "opus" => msg_type: "media"` behavior in favor of a native audio message.
<h3>Confidence Score: 3/5</h3>
- This PR is close to mergeable but has a likely Feishu API contract mismatch for audio uploads.
- Core routing logic is straightforward and consistent with existing send paths, but the new audio upload path appears to omit required metadata (`duration`) and may mislabel `.ogg` content as `opus`, which can cause send/upload failures in real use.
- extensions/feishu/src/media.ts
<sub>Last reviewed commit: 5f8ca8e</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#13669: feat(feishu): add audio message support
by AGI-XiaoBai-No1 · 2026-02-10
94.8%
#10675: feat(feishu): add audio message support and fix file upload
by YumoeZhung · 2026-02-06
90.8%
#21786: feat(feishu): extract embedded video/media from post (rich text) me...
by laopuhuluwa · 2026-02-20
80.4%
#16311: test(feishu): add regression for audio download resource type=file
by Yaxuan42 · 2026-02-14
78.3%
#20685: feat(feishu): add audio/media message support with caption cards
by mmyyfirstb · 2026-02-19
77.8%
#22957: fix(feishu): download media from quoted messages in group chats (#2...
by echoVic · 2026-02-21
74.2%
#19171: fix(feishu): pass mediaLocalRoots to sendMediaFeishu for agent-scop...
by whiskyboy · 2026-02-17
73.1%
#12755: feat(feishu): render post rich text as markdown
by WilsonLiu95 · 2026-02-09
73.0%
#9505: fix: Refactor Feishu streaming to prevent truncation and simplify s...
by zhangyi-extra · 2026-02-05
72.2%
#22735: feat(plugin): add feishu-media extension
by cintia09 · 2026-02-21
72.2%