zai-org / zai-org/feedback

Lark bot channel streaming_card reply mode leaves card stuck in running state across device sync

Open
#218 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2
Dominant language
No language data
Stars
22
Forks
1
PR merge metrics
No merged PRs in 30d

Description

提交前确认 · Pre-submission checklist

  • 我已搜索过现有 issue,确认这不是重复 / I searched existing issues and confirmed this isn't a duplicate.
  • 我已阅读 CONTRIBUTING.md / I've read CONTRIBUTING.md.

问题类别 · Category

稳定性 / Stability

涉及的 Agent 框架 · Agent framework

ZCode Agent(自研)

严重程度 · Severity

影响体验 / Affects experience

复现频率 · Reproducibility

Often (every cross-device switch during or immediately after an active response)

环境 · Environment

  • ZCode desktop v2 (Windows 11, build 2026-08-04)
  • Lark mobile app (iOS) + Lark desktop (Windows)
  • Bot provider: lark (Feishu Open Platform app, replyMode: streaming_card)
  • Active task session running on desktop, monitoring via Lark mobile

复现步骤 · Steps to reproduce

  1. Start a ZCode task session on desktop with the Lark bot channel connected (replyMode: streaming_card)
  2. Send a message from Lark mobile → ZCode processes it and streams the response back as a streaming card
  3. While the streaming card is updating (or immediately after it completes), switch from Lark mobile to Lark desktop (or vice versa)
  4. Observe the card on the device you switched TO

期望表现 · Expected behavior

The streaming card should show the completed response with no "running"/"generating" indicator after the response is done — regardless of which device views it.

实际表现 · Actual behavior

The streaming card on the newly-switched-to device shows a persistent "running" (typing/generating) indicator that never clears, even though the response text is fully delivered. The indicator stays stuck indefinitely until the user manually refreshes the conversation. The response content is correct and complete — only the card's running-state indicator is stale.

根因分析 · Root cause hypothesis

ZCode's streaming_card reply mode sends incremental card updates during streaming, but the final "completion" card update (which should clear the loading/running state — analogous to removing the "Stop Generating" button per Feishu CardKit docs) either:

  • (a) is not being sent as a distinct final update, or
  • (b) is sent but does not propagate through Lark's cross-device message sync

The issue is specifically a cross-device sync problem: the device that was viewing during streaming sees the completed state; the device that syncs after the fact sees the last pre-completion card state (stuck running).

影响 · Impact

  • Users who switch devices mid-response or immediately after see a stuck "running" indicator
  • This creates ambiguity: did the response finish, or is it still generating?
  • In agent workflows, this can cause users to think work is still happening when it is not — or miss that work completed

Workaround

Refresh the Lark conversation on the stuck device. The response is already delivered; only the card state is stale.

额外信息 · Additional context

  • The streaming_card reply mode is the only supported mode for the Lark/Feishu provider (no assistant_changes option available in the UI)
  • Related Feishu CardKit streaming bugs have been reported in the broader ecosystem (text duplication on streaming updates, pre-tool-call text loss), suggesting the streaming card system has ongoing reliability challenges
  • The Feishu CardKit docs describe a partial-update API for "deleting the Stop Generating button component after the response ends" — if ZCode is not calling this (or an equivalent completion signal) as a final step after streaming ends, that would explain the stuck state

建议修复方向 · Suggested fix direction

After the streaming response completes, send an explicit final card update that clears the running/generating state — either via the Feishu CardKit component-level "delete component" API (removing the loading indicator) or a full card update with a non-streaming final state. Ensure this final update is sent before the websocket session goes idle, so Lark's cross-device sync propagates the completed state to all devices.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No implementation file or test is named in this feedback issue; start by tracing the Lark streaming_card completion path and comparing it with Feishu CardKit's final component-update behavior. Done means a final update clears the running indicator and the completed state appears after switching devices without a manual refresh.

Written by the indexing model from the issue text.

Assessment

Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.