Repository navigation
fix(whatsapp): preserve accepted delivery and partial receipt ownership - #117198
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 31, 2026, 11:55 PM ET / August 1, 2026, 03:55 UTC. ClawSweeper reviewWhat this changesThe PR captures accepted Baileys WhatsApp receipts before later caption, mention, or activity failures, then prevents the retry layer from replaying that known partial delivery. Merge readinessThis is a focused, owner-boundary WhatsApp bug fix with no discrete correctness finding from the reviewed diff. Keep it open for the existing maintainer-labelled review path and current-head CI completion; the patch should preserve ordinary pre-accept retries while preventing duplicate replies after confirmed provider acceptance. Priority: P1 Review scores
Verification
How this fits togetherThe WhatsApp plugin turns agent replies into Baileys sends and performs follow-up caption, mention, and activity work. Its outbound retry adapter decides whether a rejected send is safe to replay, so accepted-delivery facts must reach that decision without losing the original failure. flowchart LR
A[Agent reply] --> B[WhatsApp send owner]
B --> C[Baileys relay acceptance]
C --> D[Caption, mention, activity work]
D --> E[Partial-delivery receipt]
E --> F[Outbound retry decision]
F --> G[Visible WhatsApp reply]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +30, Tests +141. Total +171 across 5 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Land the single accepted-send lifecycle and canonical retry exclusion after the current-head merge/CI refresh confirms the focused receipt and pre-accept retry cases still pass. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: an accepted first send followed by a caption, mention, or activity failure reaches the old generic disconnect retry path without a partial-delivery receipt. The branch adds focused regression coverage for those cases, although this read-only review did not execute the tests. Is this the best way to solve the issue? Yes: the patch records acceptance at the WhatsApp send owner and passes the canonical result to the existing retry owner, rather than adding a second send path or broadening retry heuristics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3374f78ad8e9. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…17198) Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
WhatsApp could already accept and deliver a message, then report a later caption-send, group-mention-resolution, or activity-bookkeeping failure without preserving the accepted provider receipt. The existing retry owner also interpreted accepted partial-delivery disconnects as ordinary retryable failures and resent the same user-visible reply up to three times.
Why This Change Was Made
Fix both failures at their existing architectural owners. One private WhatsApp accepted-send lifecycle captures the real Baileys message key immediately after the awaited provider relay, preserves every accepted voice/caption/text/poll receipt through subsequent failures, and surfaces the original cause in the canonical partial-delivery envelope. Ordinary and structured sends share that lifecycle. The existing retry owner checks the canonical accepted-delivery state before matching disconnect text, without changing legitimate pre-accept retries or unknown-timeout policy.
This is a bounded owner refactor, not a second send path, a wider retry policy, or a public SDK/configuration change. The production delta is 51 additions and 21 deletions, net 30 lines, and removes repeated quoted-send dispatch decisions.
User Impact
Accepted WhatsApp messages and voice notes remain visible and retain their actual provider message IDs even if a caption, group mention lookup, poll activity update, or later bookkeeping step fails. Accepted replies are never resent merely because that later error contains a disconnect phrase, preventing duplicate user-visible WhatsApp messages while retaining normal retries for genuine pre-delivery socket failures.
Evidence
No authentication, security, public SDK, configuration, protocol, persistent-state, database, or migration changes.