Skip to content

[Bug]: [feishu] Audio messages use wrong msg_type "media" instead of "audio" #25464

@peonai

Description

@peonai

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

  1. Generate an opus file
  2. message(action=send, channel=feishu, filePath=workspace/file.opus)
  3. Feishu returns type mismatch error
  4. Falls back to text with 📎 prefix

Environment

  • OpenClaw gateway on WSL2
  • Feishu plugin (extensions/feishu)
  • Node v24.13.1

Steps to reproduce

  1. Generate an opus file
  2. message(action=send, channel=feishu, filePath=workspace/file.opus)
  3. Feishu returns type mismatch error
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions