#10675: feat(feishu): add audio message support and fix file upload
channel: feishu
stale
Cluster:
Feishu Streaming Enhancements
## Summary
- Replace SDK file upload with native `fetch` + `FormData` to fix 0-byte upload bug caused by form-data stream measurement issues
- Add `sendAudioFeishu()` for sending playable voice messages (displayed as audio player, not file download)
- Update `sendMediaFeishu()` to detect audio files (.opus/.ogg/.mp3) and route them as voice messages
- Add media (TTS audio / images) delivery support in feishu reply dispatcher
## Changes
- `extensions/feishu/index.ts` — export new `sendAudioFeishu`
- `extensions/feishu/src/media.ts` — native fetch upload, tenant token cache, audio send, audio detection
- `extensions/feishu/src/reply-dispatcher.ts` — handle `mediaUrl` in deliver callback
## Test plan
- [ ] Send an audio file (.mp3/.opus/.ogg) via feishu → verify playable voice message
- [ ] Send a regular file → verify file download still works
- [ ] Send an image → verify image message still works
- [ ] TTS reply with mediaUrl → verify audio delivered correctly
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
- Extends Feishu media capabilities by adding a dedicated `sendAudioFeishu()` path and routing common audio extensions to send as `msg_type: "audio"`.
- Replaces SDK-based file uploads with native `fetch` + `FormData` and introduces a simple in-memory tenant token cache to address 0-byte upload issues.
- Updates the Feishu reply dispatcher to support `ReplyPayload.mediaUrl` delivery via `sendMediaFeishu` before sending any accompanying text.
<h3>Confidence Score: 3/5</h3>
- This PR is likely mergeable but has a few error-handling and correctness edge cases that can cause hard-to-debug failures in production.
- Core feature changes are straightforward, but the new native upload path assumes JSON responses and the token cache keying can break multi-domain setups; the dispatcher also swallows media delivery errors which can mask failed media-only replies.
- extensions/feishu/src/media.ts, extensions/feishu/src/reply-dispatcher.ts
<!-- 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
91.1%
#15351: feat(feishu): Add native audio message support (voice bubble)
by lovejing0306 · 2026-02-13
90.8%
#21786: feat(feishu): extract embedded video/media from post (rich text) me...
by laopuhuluwa · 2026-02-20
81.7%
#16311: test(feishu): add regression for audio download resource type=file
by Yaxuan42 · 2026-02-14
79.7%
#12755: feat(feishu): render post rich text as markdown
by WilsonLiu95 · 2026-02-09
77.0%
#22957: fix(feishu): download media from quoted messages in group chats (#2...
by echoVic · 2026-02-21
76.6%
#9505: fix: Refactor Feishu streaming to prevent truncation and simplify s...
by zhangyi-extra · 2026-02-05
76.1%
#20685: feat(feishu): add audio/media message support with caption cards
by mmyyfirstb · 2026-02-19
76.1%
#13917: fix(feishu): card rendering for tables, blockquotes, images, and ou...
by yaoting · 2026-02-11
75.9%
#22735: feat(plugin): add feishu-media extension
by cintia09 · 2026-02-21
75.8%