openclaw - 💡(How to fix) Fix [feishu] Streaming card sends incremental diff instead of full text to CardKit API

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…

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.

Fix Action

Workaround

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

Code Example

// 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;
}

---

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

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.

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 [feishu] Streaming card sends incremental diff instead of full text to CardKit API