Repository navigation
fix(feishu): preserve text before media attachments - #102397
NianJiuZst wants to merge 5 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 9, 2026, 2:18 AM ET / 06:18 UTC. Summary PR surface: Source +68, Tests +210. Total +278 across 6 files. Reproducibility: yes. at source level: current main can route final Feishu text plus media through the active streaming branch, send media without caption text, and return before normal text delivery. I did not run a live Feishu tenant reproduction in this read-only review. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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: Land one Feishu-owner fix that preserves text plus media and recovery from streaming delivery failures, with accessible redacted Feishu proof and no duplicate sibling merge. Do we have a high-confidence way to reproduce the issue? Yes at source level: current main can route final Feishu text plus media through the active streaming branch, send media without caption text, and return before normal text delivery. I did not run a live Feishu tenant reproduction in this read-only review. Is this the best way to solve the issue? Yes on direction: closing the Feishu streaming card before regular media and falling back to plain text on close/start/delivery failure is the narrow owner-boundary fix. It is not merge-ready until accessible real Feishu behavior proof is added and the overlapping fix path is coordinated. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 583ca34bf88d. Label changesLabel justifications:
Evidence reviewedPR surface: Source +68, Tests +210. Total +278 across 6 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 (9 earlier review cycles; latest 8 shown)
|
|
This pull request has been automatically marked as stale due to inactivity. |
Closes #102390
What Problem This Solves
Fixes an issue where Feishu users would lose the assistant's visible text when a final reply contained both prose and a
MEDIA:image attachment while streaming cards were active. The affected chat could show only the no-visible-reply fallback or an attachment without the intended explanation.Why This Change Was Made
The Feishu reply dispatcher now closes the final streaming text card before sending regular media attachments, so the text is committed as visible content before the attachment path runs. If the streaming close accepts no text content, the dispatcher falls back to a normal text reply before sending media; voice-media duplicate-text suppression stays on the existing path.
A real Feishu repro showed two more gaps. First, dispatcher-backed streaming block replies were being treated as delivered as soon as they were queued. If async channel delivery later failed, the block pipeline could still dedupe the final answer and leave the turn with no visible reply. The core reply path now waits for dispatcher-backed block delivery to settle when streaming callers need an acknowledgement, and the block pipeline aborts on delivery errors so the final payload remains available as fallback.
Second, a live retry hit
Create card request failed with HTTP 400while starting the Feishu streaming card. That start failure was swallowed by the preview path, leaving no active streaming session while the turn could still complete without a visible final. The Feishu dispatcher now treats streaming start as an explicit success/failure state: partial/reasoning previews only mutate streaming state after a successful start, final text+media falls back to the normal static card/media path after a start failure, block-card replies fall back to static cards if independent block delivery was not actually sent, and late partial snapshots cannot append after a final has been committed.User Impact
Feishu replies that combine a text body with an image attachment now preserve both parts of the answer. If streaming close, streaming block delivery, or streaming-card startup fails, OpenClaw keeps or re-enters the final reply path instead of silently deduping the answer away and showing the no-visible-reply fallback.
Evidence
node scripts/run-vitest.mjs src/auto-reply/reply/block-reply-pipeline.test.ts src/auto-reply/reply/dispatch-from-config.test.ts src/auto-reply/reply/agent-runner-payloads.test.ts extensions/feishu/src/reply-dispatcher.test.ts(core 350 tests, Feishu 90 tests)node scripts/run-vitest.mjs extensions/feishu/src/reply-dispatcher.test.ts(Feishu 90 tests)./node_modules/.bin/oxlint extensions/feishu/src/reply-dispatcher.ts extensions/feishu/src/reply-dispatcher.test.tsgit diff --checked94079/8a22d60still returned the no-visible fallback; logs showed the model produced the expected text+MEDIA:final, then Feishu streaming startup failed withCreate card request failed with HTTP 400, and no final was queued. Commitsed94079and8a22d60add streaming-start-failure and block-card-fallback coverage for that live gap..agents/skills/autoreview/scripts/autoreview --mode branch --base upstream/mainis clean after92e40e3: no accepted/actionable findings reported.