openclaw - 💡(How to fix) Fix [Bug] Feishu channel: interactive card content lost + mentionedBot not passed to agent

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…

When a user @mentions the bot in a Feishu group chat with requireMention: true, the message is dispatched to the agent but the agent does not know it was directly mentioned. This causes the agent to apply group-chat silence rules and not reply.

Root Cause

In /app/extensions/feishu/src/bot.ts, the buildFeishuAgentBody() function does NOT include mentionedBot in the ctx parameter:

export function buildFeishuAgentBody(params: {
  ctx: Pick<
    FeishuMessageContext,
    "content" | "senderName" | "senderOpenId" | "mentionTargets" | "messageId" | "hasAnyMention"
    // ❌ "mentionedBot" is missing!
  >;
}): string {
  let messageBody = ctx.content;
  // ...
  if (ctx.hasAnyMention) {
    messageBody += `\n\n[System: The content may include mention tags...]`;
    // But the agent doesn't know THIS message directly @mentioned them
  }
}

Meanwhile, the @BotName mention is stripped from content by normalizeMentions(), so the agent sees plain text like Please xxx without any indication it was directly addressed.

Fix Action

Fix / Workaround

Description

When a user @mentions the bot in a Feishu group chat with requireMention: true, the message is dispatched to the agent but the agent does not know it was directly mentioned. This causes the agent to apply group-chat silence rules and not reply.

Reproduction

  1. Set channels.feishu.requireMention: true
  2. In a group chat, user sends: @BotName Please xxx
  3. OpenClaw correctly identifies mentionedBot = true and dispatches the message
  4. But the agent never replies because it thinks this is just casual group chat

Code Example

function parseInteractiveCardContent(parsed: unknown): string {
  if (!isRecord(parsed)) {
    return INTERACTIVE_CARD_FALLBACK_TEXT;  // "[Interactive Card]"
  }
  const variables = readCardTemplateVariables(parsed);
  for (const elements of readInteractiveElementArrays(parsed)) {
    const text = extractInteractiveElementsText(elements, variables);
    if (text) {
      return text;
    }
  }
  return parseInteractivePostFallback(parsed) ?? INTERACTIVE_CARD_FALLBACK_TEXT;
}

---

export function buildFeishuAgentBody(params: {
  ctx: Pick<
    FeishuMessageContext,
    "content" | "senderName" | "senderOpenId" | "mentionTargets" | "messageId" | "hasAnyMention"
    // ❌ "mentionedBot" is missing!
  >;
}): string {
  let messageBody = ctx.content;
  // ...
  if (ctx.hasAnyMention) {
    messageBody += `\n\n[System: The content may include mention tags...]`;
    // But the agent doesn't know THIS message directly @mentioned them
  }
}

---

if (ctx.mentionedBot) {
  messageBody += "\n\n[System: This message directly @mentions you. Please reply.]";
}
RAW_BUFFERClick to expand / collapse

Bug 1: Interactive card content returns "[Interactive Card]" placeholder

Description

When reading Feishu messages via message action=read, interactive cards sent by the bot (e.g., cron job failure notifications) only return [Interactive Card] as content, instead of the actual card text.

Reproduction

  1. Create a cron job that sends an interactive card notification on failure
  2. Reply to that card in Feishu
  3. Try to read the card content via message action=read
  4. Result: content: "[Interactive Card]", actual card content is lost

Root Cause

In /app/extensions/feishu/src/send.ts, parseInteractiveCardContent() has limited parsing logic:

function parseInteractiveCardContent(parsed: unknown): string {
  if (!isRecord(parsed)) {
    return INTERACTIVE_CARD_FALLBACK_TEXT;  // "[Interactive Card]"
  }
  const variables = readCardTemplateVariables(parsed);
  for (const elements of readInteractiveElementArrays(parsed)) {
    const text = extractInteractiveElementsText(elements, variables);
    if (text) {
      return text;
    }
  }
  return parseInteractivePostFallback(parsed) ?? INTERACTIVE_CARD_FALLBACK_TEXT;
}

For structured cards (like cron failure notifications with complex layouts), the parser fails to extract text and falls back to the placeholder.

Expected

Either improve parseInteractiveCardContent() to handle more card structures, or expose raw card JSON in FeishuMessageInfo so callers can parse it themselves.


Bug 2: mentionedBot flag not passed to agent in group chats

Description

When a user @mentions the bot in a Feishu group chat with requireMention: true, the message is dispatched to the agent but the agent does not know it was directly mentioned. This causes the agent to apply group-chat silence rules and not reply.

Reproduction

  1. Set channels.feishu.requireMention: true
  2. In a group chat, user sends: @BotName Please xxx
  3. OpenClaw correctly identifies mentionedBot = true and dispatches the message
  4. But the agent never replies because it thinks this is just casual group chat

Root Cause

In /app/extensions/feishu/src/bot.ts, the buildFeishuAgentBody() function does NOT include mentionedBot in the ctx parameter:

export function buildFeishuAgentBody(params: {
  ctx: Pick<
    FeishuMessageContext,
    "content" | "senderName" | "senderOpenId" | "mentionTargets" | "messageId" | "hasAnyMention"
    // ❌ "mentionedBot" is missing!
  >;
}): string {
  let messageBody = ctx.content;
  // ...
  if (ctx.hasAnyMention) {
    messageBody += `\n\n[System: The content may include mention tags...]`;
    // But the agent doesn't know THIS message directly @mentioned them
  }
}

Meanwhile, the @BotName mention is stripped from content by normalizeMentions(), so the agent sees plain text like Please xxx without any indication it was directly addressed.

Expected

Pass mentionedBot to buildFeishuAgentBody and add a clear system hint when the bot is directly mentioned:

if (ctx.mentionedBot) {
  messageBody += "\n\n[System: This message directly @mentions you. Please reply.]";
}

Environment

  • OpenClaw version: v2026.5.7
  • Channel: Feishu (Lark)
  • Config: requireMention: true, groupPolicy: "open"

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 - 💡(How to fix) Fix [Bug] Feishu channel: interactive card content lost + mentionedBot not passed to agent