Skip to content

bug(gateway/feishu): CardKit streaming shows no typewriter effect in card mode #1367

Description

@SunnyYYLin

Describe the bug

When FEISHU_CARD_STREAMING_MODE=card, messages are delivered as CardKit interactive cards but with no visible typewriter/streaming effect. The full reply appears all at once after the agent finishes generating.

Root cause

In card mode, the core creates a draft placeholder (message_id="draft") because GatewayAdapter::show_streaming_placeholder() returns false. All incremental edit_message commands for the draft are skipped by the Feishu adapter dispatch seam because "draft" fails is_valid_feishu_message_id.

The only delivery happens at turn end via try_send_initial_card, which creates a CardKit card with the full accumulated text at once — no incremental updates.

Expected behavior

CardKit cards should display a typewriter effect as the agent streams content, matching how auto mode behaves after post-to-card promotion.

Reproduction

  1. Set FEISHU_CARD_STREAMING_MODE=card
  2. Send a long prompt to trigger multi-second agent response
  3. Observe: card appears with complete text at end, no incremental updates

Proposed fix

Make GatewayAdapter::show_streaming_placeholder() return true, so the core sends a real Feishu post first. The existing post-to-card promotion path in handle_card_edit/promote_and_respond takes over on the first edit, and subsequent edits stream through update_card_stream.

Relevant code

  • adapter.rs:751 — draft placeholder when show_streaming_placeholder() is false
  • gateway.rs:733show_streaming_placeholder returns false by default
  • feishu.rs:2538 — draft skip seam (is_valid_feishu_message_id)
  • feishu.rs:2642try_send_initial_card one-shot delivery
  • feishu.rs:2806handle_card_edit post-to-card promotion

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions