-
-
Notifications
You must be signed in to change notification settings - Fork 52.7k
Description
Summary
Bug
Sending .opus audio files via the Feishu plugin fails with:
The type of file upload does not match the type of message being sent.
The plugin falls back to a text message like 📎 /path/to/file.opus.
Root Cause
In extensions/feishu/src/media.ts, sendMediaFeishu uses msg_type: "media" for both audio and video:
const isMedia = fileType === "mp4" || fileType === "opus";
msgType: isMedia ? "media" : "file"But Feishu API requires:
- Audio (opus):
msg_type: "audio" - Video (mp4):
msg_type: "media"
Ref: https://open.feishu.cn/document/server-docs/im-v1/message/create
Fix
// sendFileFeishu msgType type should include "audio"
msgType?: "file" | "media" | "audio";
// sendMediaFeishu: map file types correctly
const msgType = fileType === "opus" ? "audio" : fileType === "mp4" ? "media" : "file";Reproduce
- Generate an opus file
message(action=send, channel=feishu, filePath=workspace/file.opus)- Feishu returns type mismatch error
- Falls back to text with 📎 prefix
Environment
- OpenClaw gateway on WSL2
- Feishu plugin (extensions/feishu)
- Node v24.13.1
Steps to reproduce
- Generate an opus file
message(action=send, channel=feishu, filePath=workspace/file.opus)- Feishu returns type mismatch error
- Falls back to text with 📎 prefix
Expected behavior
Opus files should be sent with msg_type: "audio" so Feishu renders them as playable voice messages, not file attachments or fallback text.
Actual behavior
Opus files are uploaded with file_type: "opus" but sent with msg_type: "media" (video type). Feishu rejects the mismatch, and the plugin falls back to sending a plain text message: 📎 /path/to/file.opus.
OpenClaw version
2026.2.22-2
Operating system
WSL2 on Windows11 — Ubuntu 24.04 / Linux 6.6.87 (x64)
Install method
No response
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
No response