Skip to content

[Bug]: Feishu card streaming truncates long responses and error messages overwrite correct replies #91916

Closed as not planned

Description

@richardataxai-lab

Description

When using the Feishu channel with streaming enabled, there are two related rendering issues:

  1. Long responses get truncated: The Feishu card displays only a partial response. The Control UI/webchat shows the complete response, but the Feishu card cuts off after a certain length.

  2. Error messages overwrite correct replies: When a tool call (e.g., elevated/sudo) fails, the error message replaces the already-displayed correct reply in the Feishu card.

Environment

  • OpenClaw version: 2026.6.5
  • Channel: Feishu (streaming mode, streaming: true)
  • Model: xiaomi/mimo-v2.5-pro
  • OS: macOS (Darwin 25.2.0, arm64)

Steps to Reproduce

Issue 1: Long response truncation

  1. Send a message via Feishu that requires a long response (e.g., technical explanation with multiple sections)
  2. Observe the Feishu card during and after streaming
  3. Compare with the Control UI output
  4. The Feishu card shows only a partial response, while Control UI shows the full content

Issue 2: Error message overwrites reply

  1. Trigger a command that requires elevated/sudo permissions from Feishu
  2. The agent first outputs the correct reply (e.g., "No sudo permission, please run manually...")
  3. The elevated command fails with an error
  4. The Feishu card is updated/replaced with the error message, losing the correct reply

Expected Behavior

  • Long responses should be fully displayed in the Feishu card (or gracefully truncated with indication)
  • Error messages from failed tool calls should NOT overwrite the agent's already-displayed reply

Actual Behavior

  • Long responses are silently truncated in Feishu cards
  • Error messages replace the correct reply content in Feishu cards

Impact

  • Users see incomplete or incorrect content in Feishu
  • Creates confusion when the displayed message changes from correct to an error
  • Degrades trust in the Feishu channel reliability

Related Issues

Additional Context

  • This is likely related to Feishu card API update limits (content length caps during streaming updates)
  • The issue is specific to the Feishu rendering layer; the agent's output is correct in the Control UI

Activity

  1. clawsweeper commented on Jun 10, 2026

    @clawsweeper
    Contributor

    Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

    Close as duplicate/superseded: the Feishu streaming-card truncation and tool-error overwrite symptoms remain real, but the older open canonical issue now tracks the same remaining content-loss, stale-content, and failed-tool-call failure class with broader source evidence and related PR coordination.

    Canonical path: Keep #77685 as the canonical Feishu streaming-card reliability tracker and carry this issue's 2026.6.5 config matrix plus CardKit response-code analysis there.

    So I’m closing this here and keeping the remaining discussion on #77685.

    Review details

    Best possible solution:

    Keep #77685 as the canonical Feishu streaming-card reliability tracker and carry this issue's 2026.6.5 config matrix plus CardKit response-code analysis there.

    Do we have a high-confidence way to reproduce the issue?

    Yes at source level, but not with a live Feishu tenant in this pass. Current main still has the implicated streaming-card update/finalization paths, and the comments provide a 2026.6.5 config matrix with consistent Feishu-only truncation symptoms.

    Is this the best way to solve the issue?

    No as a separate tracker. The best maintainable path is to consolidate the remaining Feishu streaming-card delivery work under the older open canonical issue instead of keeping duplicate issue threads open.

    Security review:

    Security review: No patch is under review and this issue is not itself a security-sensitive report.

    AGENTS.md: found and applied where relevant.

    What I checked:

    • canonical open tracker: The older open issue covers Feishu streaming-card final text loss, stale content, duplicate content, failed tool-call/error blocking, stale pending text, and long-operation card closeouts, which subsumes the two symptoms reported here.
    • current CardKit update path: Current main still sends cumulative CardKit content with an incrementing sequence and treats HTTP OK as success without parsing the Feishu response body code, matching the remaining truncation class rather than proving this issue fixed. (extensions/feishu/src/streaming-card.ts:353, 66079161d72a)
    • current final-close path: Current main still decides whether to send final card content by comparing final text to local state.sentText, which is part of the stale-content/finalization failure class tracked by the canonical issue. (extensions/feishu/src/streaming-card.ts:528, 66079161d72a)
    • current dispatcher overwrite/late-final area: Current main has explicit late-final suppression and error-closeout logic in the Feishu dispatcher; adjacent tests cover distinct late-final and error-closeout behavior, overlapping the reported tool-error overwrite symptom. (extensions/feishu/src/reply-dispatcher.ts:621, 66079161d72a)
    • related duplicate analysis: A later related issue was closed into this item for CardKit response-code analysis, while another later cleanup identified the older open canonical issue as the remaining coordinated Feishu streaming-card tracker.
    • related PR landscape: Open PRs already cover Feishu streaming-card coalescing, final overwrite, and duplication subcases; none directly closes this issue, so the best cleanup is to keep the canonical issue open for coordination rather than duplicate the tracker.

    Likely related people:

    • m1heng: The Feishu plugin package metadata describes the plugin as community maintained by this handle, making them a useful routing contact for Feishu channel behavior. (role: declared plugin contact; confidence: medium; files: extensions/feishu/package.json)
    • LeftX: Commit 65be9cc added Feishu CardKit streaming-card support across the session and dispatcher surfaces and credits the original Feishu streaming-card work. (role: introduced behavior; confidence: high; commits: 65be9ccf63f3; files: extensions/feishu/src/streaming-card.ts, extensions/feishu/src/reply-dispatcher.ts)
    • mushuiyu_xydt: Commit 1f1ce8a fixed the earlier suffix-only CardKit payload issue in the same streaming-card code and tests. (role: recent related fix author; confidence: high; commits: 1f1ce8a1fe45; files: extensions/feishu/src/streaming-card.ts, extensions/feishu/src/streaming-card.test.ts)
    • rexl2018: Commit 3bf6ed1 hardened streaming merge semantics and final reply dedupe across the same dispatcher/session boundary. (role: adjacent hardening author; confidence: high; commits: 3bf6ed181e03; files: extensions/feishu/src/streaming-card.ts, extensions/feishu/src/reply-dispatcher.ts, extensions/feishu/src/reply-dispatcher.test.ts)
    • Ted Li: Commit 8c8f396 added late streaming-card final suppression logic and tests, which overlap the reported later-error/final overwrite surface. (role: adjacent behavior contributor; confidence: high; commits: 8c8f3969856f; files: extensions/feishu/src/reply-dispatcher.ts, extensions/feishu/src/reply-dispatcher.test.ts)

    Codex review notes: model internal, reasoning high; reviewed against 66079161d72a.

  2. added
    P1High-priority user-facing bug, regression, or broken workflow.
    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.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    and removed
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    on Jun 10, 2026
  3. airbing11 commented on Jun 11, 2026

    @airbing11
    Contributor

    Cross-ref from #88929 (closed as fixed via #90181, but still reproducing for us on shipped 2026.6.5).

    Our environment

    • OpenClaw: 2026.6.5 (5181e4f)
    • Install: nvm global (/root/.nvm/versions/node/v22.22.2/lib/node_modules/openclaw/)
    • Gateway: systemd, nvm openclaw.mjs gateway
    • Deployment: Tencent Cloud Lighthouse, Ubuntu, Feishu websocket
    • Model: deepseek/deepseek-v4-flash
    • Config: streaming: true, renderMode: card, blockStreaming: false

    Verification that #90181 is in dist

    grep -rn "resolveStreamingCardAppendContent" .../openclaw/dist/
    # → no matches

    So this is not "still on 6.1 without the patch". Suffix-only helper is gone, but user-visible behavior is unchanged.

    Symptoms (match both issues here)

    1. During streaming: abnormal typewriter — text appears 1–2 characters at a time.
    2. After streaming completes: card body shows only the last character or punctuation (e.g. ? / ?).
    3. Conversation list preview (left sidebar under the contact): the same reply appears to show the full or much more complete text, while the in-thread card body remains truncated.

    This looks like the summary vs content-element divergence described in #88867 / our #88929 follow-up — full text may reach the summary/closeout path while the CardKit content element stays on the last partial chunk or fails to replace correctly.

    Overlap with #91916

    • Same 2026.6.5 regression surface after fix(feishu): preserve streaming card content #90181.
    • Same workaround: streaming: false + renderMode: card → complete content.
    • Your ClawSweeper notes on deliver(final) replacing accumulated streamText and replaceCardContent on non-prefix finals align with what we observe (final card stuck on tail punctuation even when list preview looks complete).

    Happy to provide gateway logs if useful. Original thread: #88929 (author: @airbing11).

  4. airbing11 commented on Jun 11, 2026

    @airbing11
    Contributor

    Structured repro: config matrix on 2026.6.5 (still broken after #90181)

    Environment

    • OpenClaw: 2026.6.5 (5181e4f)
    • Feishu plugin: @openclaw/feishu@2026.6.5
    • Model: deepseek/deepseek-v4-flash
    • Connection: websocket (Tencent Cloud VPS, nvm install)
    • #90181 present in dist: resolveStreamingCardAppendContent NOT FOUND

    Config matrix (5 attempts, same symptom every time)

    # streaming renderMode blockStreaming blockStreamingCoalesce chunkMode Result
    1 true card false — — ❌ fragmented typewriter + final card shows only last char (?)
    2 true auto false — — ❌ same
    3 true auto false enabled 300/2000ms newline ❌ same
    4 true auto true enabled 300/2000ms newline ❌ same (not empty — still truncated tail)
    5 true auto true removed removed ❌ same

    Consistent symptoms

    Conclusion

    • Not a user misconfiguration (renderMode / blockStreaming / coalesce / chunkMode ruled out)
    • Not fixed by fix(feishu): preserve streaming card content #90181 alone on shipped 2026.6.5
    • Likely remaining issues in reply-dispatcher finalize path and/or content-element vs summary divergence at close (see ClawSweeper notes on this issue)

    Cross-ref: #88929 (closed prematurely), author @airbing11

  5. locked as resolved and limited conversation to collaborators on Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions