fix(whatsapp): deliver final error payloads so incomplete-turn errors reach users#84578
fix(whatsapp): deliver final error payloads so incomplete-turn errors reach users#84578NianJiuZst wants to merge 1 commit into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 24, 2026, 2:04 AM ET / 06:04 UTC. Summary PR surface: Source -1, Tests +18. Total +17 across 4 files. Reproducibility: yes. for a source-level reproduction: current main and v2026.6.10 still filter final WhatsApp Review metrics: 1 noteworthy metric.
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:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the focused WhatsApp mitigation after redacted WhatsApp transport proof or explicit maintainer risk acceptance, while keeping broader cross-channel fallback semantics on #87561. Do we have a high-confidence way to reproduce the issue? Yes for a source-level reproduction: current main and v2026.6.10 still filter final WhatsApp Is this the best way to solve the issue? Yes, this is the best narrow WhatsApp mitigation I found: it opens the final-error path at both current suppression gates while preserving hidden/non-final suppression in the dispatch layer. The broader durable final fallback contract remains separate in #87561. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fd66b44f5e2c. Label changesLabel justifications:
Evidence reviewedPR surface: Source -1, Tests +18. Total +17 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
|
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
299ef9a to
c0c2be9
Compare
Summary
Fixes #84569 — WhatsApp silently drops
isErrorreply payloads, so incomplete-turn error messages (payloads=0) are never delivered. Users see no response when a model call stalls or times out.Two changes:
resolveWhatsAppDeliverablePayloadnow allowsisErrorpayloads through forkind: "final"(previously dropped all)outbound-base.tssendPayloadno longer returns an empty message id forisErrorpayloads (previously suppressed at the transport level)Non-final error payloads (tool/block noise) remain filtered. User-facing final error text is normalized and sent normally through the WhatsApp send pipeline.
Changes
extensions/whatsapp/src/auto-reply/monitor/inbound-dispatch.ts:isErrorfilter gated to non-final kinds — final error payloads now reachdeliverReplyextensions/whatsapp/src/outbound-base.ts: removedisErrorearly return insendPayload— error payloads are sent throughsendTextMediaPayloadextensions/whatsapp/src/auto-reply/monitor/inbound-dispatch.test.ts: replaced "suppresses error payload text" test with "delivers final error payload text" + "still suppresses non-final error payloads"extensions/whatsapp/src/outbound-adapter.sendpayload.test.ts: replaced "suppresses routed error payloads" with "delivers routed error payloads"Real behavior proof
Behavior addressed: WhatsApp drops all isError reply payloads before delivery and at the transport layer. Incomplete-turn error messages are never sent to the user.
Real environment tested: macOS Darwin 25.4.0 (arm64), Node.js v24.14.1, OpenClaw 2026.5.19 (c0c2be9)
Exact steps or command run after this patch:
Evidence after fix (regression/unit tests):
Evidence after fix (real WhatsApp runtime — imports resolveSendableOutboundReplyParts from WhatsApp extension, exercises exact production dispatcher + outbound logic via
npx tsx):Observed result after fix: 99 tests pass. Standalone npx tsx runtime proof imports the real WhatsApp module, exercises the exact production
resolveWhatsAppDeliverablePayloadandsendPayloadlogic. Before fix: incomplete-turn error dropped at both dispatcher and outbound boundaries. After fix: final isError delivered through both boundaries with real messageId; tool errors and reasoning blocks remain correctly suppressed.What was not tested: Live WhatsApp Business API session with a real stalled agent turn (requires live credentials and a long-running model call)
🤖 Generated with Claude Code