Repository navigation
fix(feishu): preserve text when replies include media - #102399
ZengWen-DT wants to merge 3 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 18, 2026, 9:59 PM ET / July 19, 2026, 01:59 UTC. Summary PR surface: Source +47, Tests +184. Total +231 across 4 files. Reproducibility: yes. source-reproducible: a final Feishu reply containing text plus a regular Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Keep the narrow card-close/fallback design only if a redacted live Feishu run demonstrates both the committed final text and a successfully delivered regular attachment; compare the wider failure handling in #102397 separately rather than merging both overlapping fixes blindly. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: a final Feishu reply containing text plus a regular Is this the best way to solve the issue? Yes for the narrow active-card case: committing the stream or explicitly restoring final text before media preserves the existing separate media path. It is not yet proven end-to-end, and the broader failure cases in #102397 require a separate maintainer comparison. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 047232bd16e4. Label changesLabel justifications:
Evidence reviewedPR surface: Source +47, Tests +184. Total +231 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (6 earlier review cycles)
|
f494343 to
e9c8ec7
Compare
|
@clawsweeper re-review Updated the Feishu dispatcher to use the streaming close visibility result. If close reports no visible text, the final text is sent as a normal message before media attachments, and the regression test now covers that close-false/media-success path. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
e9c8ec7 to
86f8c3d
Compare
Close or fall back final streaming text before delivering regular media attachments, and treat Feishu CardKit business errors as failed mutations. Co-authored-by: Wynne668 <[email protected]>
86f8c3d to
6b2e449
Compare
|
Closing — the core issue reported in #102390 is no longer reproducible on The The edge cases this PR additionally guards (streaming start failure, close rejection) are real but narrow. If they cause user-visible issues, a new issue/PR can target them specifically. The overlapping PR #102397 is also open and may cover these paths more comprehensively. |
Closes #102390
What Problem This Solves
Fixes an issue where Feishu users would lose the visible text from an assistant final reply when that reply also included a regular
MEDIA:attachment while streaming cards were active. The channel could finish with only the no-visible-content fallback instead of showing the assistant's text alongside the attachment.Why This Change Was Made
The Feishu streaming reply path now closes the active final streaming card before dispatching regular media attachments, and it falls back to a normal text send first if the streaming close reports that no text became visible. That keeps the final text visible while preserving the existing separate media send behavior and the voice-media text suppression path.
AI-assisted.
User Impact
Feishu replies that combine text with an image or other regular attachment now keep the assistant's text visible and still send the attachment. Users should no longer see the misleading "reply completed without visible content" fallback for this text-plus-media streaming reply shape.
Evidence
Source-level before/after
Before (
main,reply-dispatcher.ts:783-787): Streaming card is updated with final text but not closed before media dispatch — the code sends media and returns immediately, leaving the streaming card hanging:After (this PR):
closeStreaming()is called before media, with a plain-text fallback when close reports no visible content:When
closeStreaming()returnsfalse(card content was not visible), the dispatcher sends the final text as a plain Feishu message before sending the attachment, without emitting the no-visible-reply fallback.Live Feishu gateway proof (after fix)
Gateway started from the PR branch with the Feishu WebSocket channel active. A DM triggered a reply containing text plus an image attachment (canvas-generated chart). Key gateway log sequence:
The
Closed streaminglog confirmscloseStreaming()was called beforesendMediaReplies()— the exact code path this PR adds. (The image upload itself returned Feishu code 234011 "Can't recognize image format" — a content-format issue in the canvas plugin output, unrelated to the reply dispatcher fix.)Feishu client confirmation: The bot's reply text was visible in the Feishu Android app. Screenshot shows the assistant's text "Here's the monthly sales bar chart by quarter 📊" displayed correctly — no "reply completed without visible content" fallback appeared.
Focused test proof
Two new regression tests cover the exact paths:
closes streaming final text before sending regular media attachments— close succeeds, media sent, no fallbackfalls back to plain final text when streaming close accepts no content before media— close returns false, plain text sent before mediaAdditional checks
AI-assisted. Real behavior proof collected by human (live Feishu gateway logs + Feishu Android client screenshot).