Skip to content

[feishu] Streaming card sends incremental diff instead of full text to CardKit API #88335

@longdoubled7

Description

@longdoubled7

Bug Description

In card mode with streaming enabled, the Feishu plugin sends incremental text diffs to the CardKit API instead of the full text content. This causes fragmented/flickering display on the client side — each streaming update shows only the new fragment rather than appending to existing text with a typewriter effect.

Root Cause

resolveStreamingCardAppendContent() in monitor.account-*.js computes a diff:

// Line 754-757
function resolveStreamingCardAppendContent(previousText, nextText) {
    if (!nextText || nextText === previousText) return "";
    if (!previousText) return nextText;
    return nextText.startsWith(previousText) ? nextText.slice(previousText.length) : nextText;
}

This diff is passed to updateCardContent()PUT /cardkit/v1/cards/{id}/elements/content/content as the content field.

However, per Feishu CardKit streaming docs:

持续向卡片中的普通文本元素或富文本组件传入全量文本内容。平台会自动计算增量部分,并以打字机效果逐字渲染。

(Translation: Continuously pass in the full text content to plain_text or markdown elements. The platform automatically calculates the incremental part and renders it character by character with a typewriter effect.)

The API expects the full text each time. The platform itself calculates the delta for typewriter rendering.

Expected Behavior

Each streaming update should send the full accumulated text. The CardKit platform auto-computes the diff for typewriter effect.

Suggested Fix

function resolveStreamingCardAppendContent(previousText, nextText) {
    if (!nextText || nextText === previousText) return "";
    return nextText; // Send full text; CardKit platform handles delta calculation
}

Environment

  • OpenClaw: 2026.5.27
  • @openclaw/feishu: (bundled)
  • Feishu client: latest

Workaround

Setting streaming: false on the feishu account config disables streaming and avoids the issue, at the cost of no real-time output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.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.

    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