Skip to content

[Feishu] Card streaming creates duplicate card on every response (counts.final=2) #62059

@longdoubled7

Description

@longdoubled7

Environment

  • OpenClaw version: 2026.4.5 (3e72c03)
  • Feishu plugin version: 2026.3.8
  • Channel: Feishu (card mode, streaming enabled)
  • Node: v22.22.1, Linux arm64

Description

Every response dispatch creates two streaming card messages in Feishu DMs. The first card receives the full streamed content, and a second identical card (without streaming content) is created ~1 second later.

Root Cause Analysis

Traced through the codebase:

  1. In monitor-BFekcwtJ.js, the createFeishuReplyDispatcher deliver callback calls startStreaming() on first block delivery (creates card fix: add @lid format support and allowFrom wildcard handling #1), then calls closeStreaming() on final delivery (closes card fix: add @lid format support and allowFrom wildcard handling #1 via PATCH to /cardkit/v1/cards/{cardId}/settings).

  2. However, counts.final consistently shows 2 in dispatch logs:

feishu[default]: dispatch complete (queuedFinal=false, replies=2)
  1. In dispatch-CYHzwBjK.js, queuedCounts.final increments per sendFinalReply() call. A count of 2 means sendFinalReply() is called twice for a single response.

  2. The first sendFinalReply call closes the streaming card. The second call hits startStreaming() after closeStreaming() has nulled streamingStartPromise, so the guard if (streaming) return fails, and a second streaming card is created and immediately closed.

Reproduction

  1. Configure Feishu renderer with renderMode: "card", cardName: "claw-default"
  2. Send any message to the bot
  3. Observe two Interactive Card messages appear in the chat

Evidence

From gateway logs (PM2):

card update delta=0ms → cardkit card created (id=7625704855768566742)
card close → cardId=7625704855768566742
card update delta=0ms → cardkit card created (id=7625705023825279638)
card close → cardId=7625705023825279638

Two separate im.message.create calls with different message IDs for a single dispatch.

Expected Behavior

Only one streaming card should be created per response. counts.final should be 1 for normal single-text responses.

Workaround

None clean. Using renderMode: "auto" still produces 2 messages (streaming card + fallback text). Only disabling card streaming entirely avoids the duplicate.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions