Bug
When sending an MP4 video via the message tool (action=send, media=path.mp4), the recipient sees a text link like 📎 /path/to/video.mp4 instead of a playable video.
Root Cause
In extensions/feishu/src/media.ts, sendMediaFeishu() determines msgType as:
// Feishu API: opus -> "audio", everything else (including video) -> "file"
const msgType = fileType === "opus" ? "audio" : "file";
This is incorrect. Feishu API requires msg_type: "media" for mp4/video files (not "file").
opus → "audio" ✅
mp4 → "media" ❌ (currently sends "file", Feishu returns error code 230055)
- other files →
"file" ✅
Fix
// Feishu API: opus -> "audio", mp4/video -> "media", everything else -> "file"
const msgType = fileType === "opus" ? "audio" : fileType === "mp4" ? "media" : "file";
Behavior
When the upload succeeds but send fails (error 230055), the sendMedia in outbound.ts falls back to:
const fallbackText = `📎 ${mediaUrl}`;
So the user sees a file path as plain text instead of the video.
Verification
Direct API call with msg_type: "media" works correctly:
curl -X POST "https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=open_id" \
-H "Authorization: Bearer $TOKEN" \
-d '{"receive_id": "ou_xxx", "msg_type": "media", "content": "{\"file_key\":\"file_v3_xxx\"}"}'
# Returns code=0 success
Bug
When sending an MP4 video via the
messagetool (action=send, media=path.mp4), the recipient sees a text link like📎 /path/to/video.mp4instead of a playable video.Root Cause
In
extensions/feishu/src/media.ts,sendMediaFeishu()determinesmsgTypeas:This is incorrect. Feishu API requires
msg_type: "media"for mp4/video files (not"file").opus→"audio"✅mp4→"media"❌ (currently sends"file", Feishu returns error code 230055)"file"✅Fix
Behavior
When the upload succeeds but send fails (error 230055), the
sendMediainoutbound.tsfalls back to:So the user sees a file path as plain text instead of the video.
Verification
Direct API call with
msg_type: "media"works correctly: