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. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. from source: current main produces an PR rating Rank-up moves:
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. Real behavior proof Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the focused WhatsApp delivery fix after redacted WhatsApp runtime proof shows the final incomplete-turn error reaches the user while non-final tool/block error noise remains suppressed. Do we have a high-confidence way to reproduce the issue? Yes from source: current main produces an Is this the best way to solve the issue? Yes, the proposed code shape is the narrowest maintainable fix I found: open the final-error path at both WhatsApp gates while preserving non-final error suppression. The remaining blocker is proof of the real WhatsApp delivery path, not a different implementation approach. Label changes:
Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against c8a953af9371. |
|
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