openclaw - ✅(Solved) Fix Feishu streaming card produces duplicate/truncated messages with long replies [1 pull requests, 5 comments, 1 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#65993Fetched 2026-04-14 05:39:22
View on GitHub
Comments
5
Participants
1
Timeline
10
Reactions
0
Participants
Timeline (top)
commented ×5referenced ×4cross-referenced ×1

Root Cause

Root cause (suspected): File dist/monitor-DS-8NLOO.js, line 693:

this.updateThrottleMs = 100;

Fix Action

Workaround

Setting agents.defaults.blockStreamingDefault: "off" in config partially mitigates the issue but does not fully resolve it.

PR fix notes

PR #66148: fix(feishu): remove streaming card update throttle to prevent duplicates

Description (problem / solution / changelog)

What does this PR do?

Removes artificial 100ms throttling from Feishu streaming card updates to eliminate duplicate and truncated messages when handling long replies.

Fixes #65993

Problem Statement

Feishu streaming cards produce duplicate or truncated messages when handling long replies (>1000 characters).

Root cause: The updateThrottleMs = 100 throttle in FeishuStreamingSession causes updates to be dropped when content blocks arrive faster than 100ms intervals. When close() is called with accumulated unsent text (pendingText), the content is truncated. Then the fallback sendChunkedTextReply sends the full content, resulting in duplicate messages.

User impact:

  • Case A (light): One streaming card + one additional non-streaming block with partial content
  • Case B (severe): Multiple message blocks with content from early blocks lost or duplicated

Why Telegram/Discord unaffected: They use editMessageText on a draft message without throttling. Feishu uses throttled card updates via FeishuStreamingSession.

Solution Applied

Changed updateThrottleMs from 100 to 0 in extensions/feishu/src/streaming-card.ts:172.

Why this solves the bottleneck:

  • Eliminates artificial delay that causes update drops
  • Feishu Card Kit API is designed for rapid updates (configured with print_frequency_ms: 50)
  • No updates skipped = no content loss = no truncation = no duplicates
  • Streaming cards now update immediately as content arrives

Why this is safe:

  • User validated 0ms throttle in production with no issues
  • Feishu's server-side rate limiting handles any excessive requests
  • Telegram/Discord successfully use 0ms throttle for streaming updates
  • No breaking changes - existing behavior improves

Changes

Modified:

  • extensions/feishu/src/streaming-card.ts:172 - Changed updateThrottleMs from 100 to 0

Testing:

  • ✅ All existing tests pass (7/7)
  • ✅ Type check passes
  • ✅ User validated in production

Test Plan

Automated:

  • Existing test suite passes
  • TypeScript compilation succeeds

Manual verification (for maintainers):

  1. Configure Feishu channel with streaming: true and renderMode: "card"
  2. Send request generating long reply (>1000 chars)
  3. Observe output in Feishu app
  4. Verify: Single streaming card with smooth incremental updates
  5. Verify: No duplicate message blocks
  6. Verify: No truncated content

Expected behavior:

  • Single streaming card message
  • Smooth incremental updates without 100ms delays
  • Complete final message
  • No duplicates or truncation

Changed files

  • extensions/feishu/src/streaming-card.ts (modified, +1/-10)

Code Example

this.updateThrottleMs = 100;
RAW_BUFFERClick to expand / collapse

Bug Description

When using Feishu channel with streaming: true and renderMode: "card" (default configuration), long replies produce duplicate or truncated message blocks.

Reproduction steps:

  1. Configure Feishu channel with streaming enabled
  2. Send a request that generates a long reply (> ~1000 chars)
  3. Observe the output in Feishu app

Expected behavior: A single streaming card message with smooth incremental updates, followed by a final complete message.

Actual behavior:

  • Case A (light): One streaming card + one additional non-streaming block with partial content
  • Case B (severe): Multiple message blocks, with content from early blocks lost or duplicated

Technical Analysis

Root cause (suspected): File dist/monitor-DS-8NLOO.js, line 693:

this.updateThrottleMs = 100;

The queueStreamingUpdate() function applies 100ms throttling per update. When blocks arrive faster than 100ms intervals, updates are skipped/delayed and content is lost. When final arrives and triggers closeStreaming(), accumulated but unsent text is truncated, then sendChunkedTextReply sends the full content via fallback path, causing duplicates.

Why Telegram/Discord don't have this issue: They use editMessageText on a draft message (no throttle). Feishu uses throttled card updates via FeishuStreamingSession.

Workaround

Setting agents.defaults.blockStreamingDefault: "off" in config partially mitigates the issue but does not fully resolve it.

Environment

  • OpenClaw version: 2026.4.8
  • Feishu plugin version: 2026.4.8
  • Node.js version: v22.x
  • Deployment: Linux VM

extent analysis

TL;DR

Adjusting the updateThrottleMs value in dist/monitor-DS-8NLOO.js may help mitigate the issue of duplicate or truncated message blocks in Feishu channel with streaming enabled.

Guidance

  • Review the queueStreamingUpdate() function to understand how the 100ms throttling affects the update process and consider increasing the updateThrottleMs value to reduce skipped updates.
  • Test the workaround of setting agents.defaults.blockStreamingDefault: "off" in the config, although it may not fully resolve the issue, to see if it improves the behavior.
  • Investigate the sendChunkedTextReply function to understand why it sends the full content via fallback path, causing duplicates, and consider modifying it to handle accumulated text more efficiently.
  • Consider implementing a mechanism similar to Telegram/Discord's editMessageText on a draft message to avoid throttled card updates.

Example

// Example of increasing the updateThrottleMs value
this.updateThrottleMs = 500; // increase from 100ms to 500ms

Notes

The provided analysis suggests that the issue is specific to Feishu's throttled card updates, and modifying the updateThrottleMs value or implementing a different update mechanism may help resolve the issue. However, further testing and investigation are necessary to determine the best solution.

Recommendation

Apply workaround: Adjust the updateThrottleMs value to a higher interval (e.g., 500ms) to reduce the likelihood of skipped updates and truncated content. This change may help mitigate the issue, but further testing is necessary to determine its effectiveness.

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