#9505: fix: Refactor Feishu streaming to prevent truncation and simplify state
channel: feishu
stale
Cluster:
Feishu Streaming Enhancements
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR refactors Feishu streaming-card updates to avoid truncation by tracking committed vs in-flight text, adds a dedup/queueing strategy for ordered updates, and tweaks message handling to commit completed blocks and close streaming without passing final text. It also adjusts Feishu media download to map audio/video to the Feishu message-resource API’s supported `type` values.
<h3>Confidence Score: 4/5</h3>
- Safe to merge after fixing the identified correctness issue in streaming card summaries.
- Core logic changes are localized and generally consistent, but the summary calculation in `FeishuStreamingSession.close()` can now diverge from the actual final card text in the exact truncation scenario this PR targets.
- src/feishu/streaming-card.ts
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#11084: feat(feishu): implement CardKit streaming card output with typewrit...
by liuhui201069 · 2026-02-07
82.1%
#10675: feat(feishu): add audio message support and fix file upload
by YumoeZhung · 2026-02-06
76.1%
#13917: fix(feishu): card rendering for tables, blockquotes, images, and ou...
by yaoting · 2026-02-11
76.0%
#22675: feishu: move message dedup to just before dispatch
by zijiegeng · 2026-02-21
74.9%
#19027: fix(feishu): keep chunked messages in topic/thread context
by qiangu · 2026-02-17
74.9%
#9006: fix: streaming UI, session locks, routing performance, plugin sandb...
by facundollamas2007 · 2026-02-04
74.6%
#23720: Feat/cli backend runtime tuning
by wanmorebot · 2026-02-22
74.5%
#8353: fix(ui): display tool calls during webchat streaming
by MarvinDontPanic · 2026-02-03
74.3%
#4495: Fix: emit final assistant event when reply tags hide stream
by ukeate · 2026-01-30
74.1%
#14037: docs: improved permission configuration instructions
by LHB6540 · 2026-02-11
73.9%