openclaw - 💡(How to fix) Fix Feishu streaming card duplicates on long responses (飞书流式卡片长回复重复) [2 comments, 2 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#75757Fetched 2026-05-02 05:30:40
View on GitHub
Comments
2
Participants
2
Timeline
3
Reactions
2
Author
Timeline (top)
commented ×2closed ×1

Root Cause

The issue is in the Feishu integration's streaming card logic at extensions/feishu/src/monitor-DDkD5r4p.js in createFeishuReplyDispatcher.

In the deliver(final) path:

  1. If streaming is active, it calls closeStreaming() which destroys the current streaming card
  2. Then adds the final text to deliveredFinalTexts
  3. On the next reply, the final text is NOT in deliveredFinalTexts, so a new card is created

Additionally, the 100ms throttle in queueStreamingUpdate causes content truncation on long responses, hitting a fallback path that also creates a second card.

Fix Action

Fix / Workaround

The issue is in the Feishu integration's streaming card logic at extensions/feishu/src/monitor-DDkD5r4p.js in createFeishuReplyDispatcher.

This patch is applied locally and needs re-application after each OpenClaw update.

Code Example

if (info?.kind === "final") {
    streamText = mergeStreamingText(streamText, text);
-   await closeStreaming();
-   deliveredFinalTexts.add(text);
+   queueStreamingUpdate(text, { mode: "snapshot" });
  }
RAW_BUFFERClick to expand / collapse

Problem

When using Feishu (飞书) as the chat channel, long AI responses produce two streaming cards instead of one. Short single-stream responses work fine, but any response that triggers multiple stream blocks + final delivery always creates a duplicate card.

Root Cause

The issue is in the Feishu integration's streaming card logic at extensions/feishu/src/monitor-DDkD5r4p.js in createFeishuReplyDispatcher.

In the deliver(final) path:

  1. If streaming is active, it calls closeStreaming() which destroys the current streaming card
  2. Then adds the final text to deliveredFinalTexts
  3. On the next reply, the final text is NOT in deliveredFinalTexts, so a new card is created

Additionally, the 100ms throttle in queueStreamingUpdate causes content truncation on long responses, hitting a fallback path that also creates a second card.

Related Issues

  • #62059 — Two streaming cards per response
  • #65993 — 100ms throttling causes duplicates
  • #46135 / #43612 — Related issues
  • PR #42940 — Reference fix approach

Suggested Fix

Replace the closeStreaming() call in the final branch with queueStreamingUpdate(text, { mode: "snapshot" }):

  if (info?.kind === "final") {
    streamText = mergeStreamingText(streamText, text);
-   await closeStreaming();
-   deliveredFinalTexts.add(text);
+   queueStreamingUpdate(text, { mode: "snapshot" });
  }

Why: snapshot mode refreshes the streaming card content in-place and keeps the card alive, instead of closing and recreating it. The subsequent onIdle handler will close the card naturally, preventing duplicates.

Additional Notes

Adjusting channels.feishu.blockStreamingCoalesce from the default 50/200ms to 500/2000ms reduces truncation risk on long responses.

This patch is applied locally and needs re-application after each OpenClaw update.

extent analysis

TL;DR

Replace the closeStreaming() call with queueStreamingUpdate(text, { mode: "snapshot" }) to prevent duplicate streaming cards.

Guidance

  • Review the createFeishuReplyDispatcher function in extensions/feishu/src/monitor-DDkD5r4p.js to understand the current streaming card logic.
  • Apply the suggested fix by replacing closeStreaming() with queueStreamingUpdate(text, { mode: "snapshot" }) in the deliver(final) path.
  • Consider adjusting channels.feishu.blockStreamingCoalesce to reduce truncation risk on long responses.
  • Verify the fix by testing with long AI responses and checking for duplicate cards.

Example

  if (info?.kind === "final") {
    streamText = mergeStreamingText(streamText, text);
-   await closeStreaming();
-   deliveredFinalTexts.add(text);
+   queueStreamingUpdate(text, { mode: "snapshot" });
  }

Notes

This fix is based on the provided patch and may need to be reapplied after each OpenClaw update.

Recommendation

Apply the workaround by replacing closeStreaming() with queueStreamingUpdate(text, { mode: "snapshot" }), as it prevents duplicate streaming cards and reduces truncation risk.

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 duplicates on long responses (飞书流式卡片长回复重复) [2 comments, 2 participants]