openclaw - ✅(Solved) Fix Feishu: CardKit streaming cards show [Interactive Card] instead of actual content when read by other agents [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#54972Fetched 2026-04-08 01:34:00
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×1

Root Cause

In extensions/feishu/src/send.ts, the parseInteractiveCardContent() function (line ~151) only parses elements-level div and markdown tags. However, CardKit streaming cards are sent as:

{ "type": "card", "data": { "card_id": "xxx" } }

This format has no elements property, so the function falls back to [Interactive Card].

Fix Action

Workaround

Setting streaming: false in Feishu channel config causes replies to be sent as plain text messages, which other agents can read normally. But this degrades UX (no typing effect).

PR fix notes

PR #55466: fix(feishu): read full CardKit streaming card content via raw_card_content param

Description (problem / solution / changelog)

Problem

When reading messages that were sent as CardKit streaming cards (created via POST /cardkit/v1/cards), the IM API (GET /im/v1/messages/{message_id}) returns fallback content (a screenshot image + placeholder text like [Interactive Card]) instead of the actual card text content. This makes it impossible to retrieve the full text of bot replies that use streaming cards.

Root Cause

CardKit streaming cards are referenced by card_id in the message body ({"type":"card","data":{"card_id":"xxx"}}). The CardKit API only provides write endpoints — there is no read API to fetch card content by card_id. However, the IM message read API supports an undocumented query parameter card_msg_content_type=raw_card_content that instructs the API to inline the full card structure as a json_card field in the response content.

Fix

1. Pass card_msg_content_type parameter

Add card_msg_content_type: "raw_card_content" to both:

  • client.im.message.get() — used by getMessageFeishu() for single message reads
  • client.im.message.list() — used by listFeishuThreadMessages() for thread history

2. Parse json_card format in parseInteractiveCardContent

Before the existing element-based parsing, check for the json_card field (a JSON string) and extract text from:

  • config.summary.content — the card summary (streaming cards write the full reply text here)
  • body.elements — recursively extract plain_text and markdown nodes, including nested structures like column_set

Falls through to the existing elements / body.elements parsing if json_card is absent or unparseable.

3. Tests

Added 3 new test cases:

  • Verifies card_msg_content_type param is passed to message.get
  • Verifies json_card format is correctly parsed (summary + nested body elements)
  • Verifies fallback to legacy elements when json_card contains invalid JSON

Related Issues

  • Relates to #54972 (CardKit streaming card content not readable)
  • Relates to #48281 (Interactive card message parsing)
  • Relates to #32930 (Message content retrieval improvements)

References

  • The official Lark plugin (larksuite/openclaw-lark) uses the same card_msg_content_type=raw_card_content parameter in its fetchCardContent function (src/messaging/inbound/parse-io.ts).

Changed files

  • extensions/feishu/src/send.test.ts (modified, +105/-0)
  • extensions/feishu/src/send.ts (modified, +89/-8)

Code Example

{ "type": "card", "data": { "card_id": "xxx" } }

---

2026-03-26T14:30:34.980+08:00 [feishu] feishu[content]: fetched quoted message: [Interactive Card]
2026-03-26T12:57:03.283+08:00 [feishu] feishu[main]: fetched quoted message: [Interactive Card]
2026-03-26T14:17:23.231+08:00 [feishu] feishu[content]: fetched quoted message: [Interactive Card]
RAW_BUFFERClick to expand / collapse

Bug Description

When an agent replies in a Feishu group chat using streaming mode (default), the reply is sent as a CardKit interactive card. When another agent in the same group tries to read/quote that message, it only sees [Interactive Card] instead of the actual text content.

Root Cause

In extensions/feishu/src/send.ts, the parseInteractiveCardContent() function (line ~151) only parses elements-level div and markdown tags. However, CardKit streaming cards are sent as:

{ "type": "card", "data": { "card_id": "xxx" } }

This format has no elements property, so the function falls back to [Interactive Card].

Steps to Reproduce

  1. Set up multiple agents sharing a Feishu group chat
  2. Have Agent A reply to a message (streaming mode enabled, which is default)
  3. Have Agent B try to read/quote Agent A's reply
  4. Agent B sees [Interactive Card] instead of the actual content

Evidence from Logs

2026-03-26T14:30:34.980+08:00 [feishu] feishu[content]: fetched quoted message: [Interactive Card]
2026-03-26T12:57:03.283+08:00 [feishu] feishu[main]: fetched quoted message: [Interactive Card]
2026-03-26T14:17:23.231+08:00 [feishu] feishu[content]: fetched quoted message: [Interactive Card]

Proposed Fix

In parseQuotedMessageContent() when handling msgType === "interactive":

  1. Detect if the parsed content is a CardKit reference ({ type: "card", data: { card_id: "xxx" } })
  2. If so, call GET /open-apis/cardkit/v1/cards/{card_id} to fetch the actual card content
  3. Extract the markdown/text from the card body

Alternatively, a simpler approach: when parseInteractiveCardContent encounters a card_id reference, use the existing getToken() + fetchWithSsrFGuard() to resolve the card content.

Workaround

Setting streaming: false in Feishu channel config causes replies to be sent as plain text messages, which other agents can read normally. But this degrades UX (no typing effect).

Environment

  • OpenClaw 2026.3.13 (61d171a)
  • Feishu stock plugin (bundled)
  • Multi-agent setup with shared group chats

Impact

This blocks multi-agent collaboration in Feishu group chats, as agents cannot read each other's replies when streaming is enabled (default).

extent analysis

Fix Plan

To fix the issue, we need to modify the parseInteractiveCardContent() function to handle CardKit references. Here are the steps:

  • Modify the parseInteractiveCardContent() function to detect CardKit references:
if (content.type === 'card' && content.data.card_id) {
  // Fetch the actual card content using the card ID
  const cardContent = await fetchCardContent(content.data.card_id);
  return extractMarkdownFromCard(cardContent);
}
  • Implement the fetchCardContent() function to fetch the card content using the Feishu API:
async function fetchCardContent(cardId: string) {
  const token = getToken();
  const response = await fetchWithSsrFGuard(`https://open.feishu.cn/open-apis/cardkit/v1/cards/${cardId}`, {
    method: 'GET',
    headers: {
      Authorization: `Bearer ${token}`,
    },
  });
  return await response.json();
}
  • Implement the extractMarkdownFromCard() function to extract the markdown/text from the card body:
function extractMarkdownFromCard(cardContent: any) {
  // Extract the markdown/text from the card body
  // This may vary depending on the card structure
  return cardContent.card.body.markdown;
}

Verification

To verify the fix, follow these steps:

  • Set up a Feishu group chat with multiple agents
  • Enable streaming mode (default)
  • Have one agent reply to a message
  • Have another agent try to read/quote the reply
  • Verify that the actual content is displayed instead of [Interactive Card]

Extra Tips

  • Make sure to handle errors and exceptions properly when fetching and parsing the card content
  • Consider caching the card content to improve performance
  • Test the fix thoroughly to ensure it works for different types of cards and messages.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix Feishu: CardKit streaming cards show [Interactive Card] instead of actual content when read by other agents [1 pull requests, 1 participants]