Skip to content

[Bug] Feishu plugin: message read returns "[Interactive Card]" instead of actual card content #78289

Description

@longdoubled7

问题描述

当使用 OpenClaw 的 message(action=read) 工具读取飞书卡片消息时,返回的 content 只有 [Interactive Card],无法获取卡片的实际内容(markdown 正文等)。

根因分析

飞书 API 的 GET /open-apis/im/v1/messages/:message_id 有一个查询参数 card_msg_content_type

  • 不传(默认):返回降级结构,只有标题和 "请升级客户端" 提示
  • user_card_content:返回发送时的完整原始卡片 JSON(Card 1.0/2.0)

OpenClaw 飞书插件在两个函数中调用飞书 API 时都没有传递这个参数:

  1. getMessageFeishu(文件 send-DowxxbpH.js):
// 当前代码
const response = await client.im.message.get({ path: { message_id: messageId } });

// 建议修改为
const response = await client.im.message.get({ 
  path: { message_id: messageId }, 
  params: { card_msg_content_type: 'user_card_content' } 
});
  1. listFeishuThreadMessages
// 当前代码
const response = await createFeishuClient(account).im.message.list({ params: {
  container_id_type: "thread",
  container_id: threadId,
  sort_type: "ByCreateTimeDesc",
  page_size: Math.min(limit + 1, 50)
} });

// 建议修改为
const response = await createFeishuClient(account).im.message.list({ params: {
  container_id_type: "thread",
  container_id: threadId,
  sort_type: "ByCreateTimeDesc",
  page_size: Math.min(limit + 1, 50),
  card_msg_content_type: 'user_card_content'
} });

解析层已兼容

parseInteractiveCardContent 函数已经能处理 Card 2.0 的 body.elements 结构(支持 markdownlark_mddiv 等标签),只需要 API 层返回完整数据即可正确解析。

飞书官方文档参考

环境信息

  • OpenClaw: 2026.5.3
  • @openclaw/feishu: 2026.5.3
  • 飞书 SDK: @larksuiteoapi/node-sdk

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.no-staleExclude from stale automation

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions