← Back to PRs

#10675: feat(feishu): add audio message support and fix file upload

by YumoeZhung open 2026-02-06 20:50 View on GitHub →
channel: feishu stale
## 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