Repository navigation
fix(whatsapp): silently drops inbound messages when more than 450 are waiting - #116179
Conversation
… waiting WhatsApp asked the shared ingress monitor to enforce a 450-entry cap and a 30-day TTL on pending durable ingress rows. Pending rows are undelivered work, not history, and the monitor runs retention before its first claim, so an account holding 451 accepted messages lost the oldest one to a hard DELETE before it could ever be dispatched. Loss scaled linearly with backlog depth and left no tombstone, no failure record, and no retained payload. Drop pendingTtlMs and pendingMaxEntries from the WhatsApp retention config. Completed and failed retention is unchanged so on-disk history stays bounded, and the config now matches every other channel on the shared monitor, whose defaults cover completed and failed only. The two values were carried over mechanically from the pre-SQLite openKeyedStore replay-guard cache in b0679d1 and inlined verbatim in openclaw#115824. Add regression coverage driving the real monitor and the real SQLite ingress queue over 451 accepted records.
|
Codex review: needs maintainer review before merge. Reviewed July 29, 2026, 11:55 PM ET / July 30, 2026, 03:55 UTC. ClawSweeper reviewWhat this changesThe branch removes WhatsApp’s 30-day/450-entry retention limits for pending durable inbound messages and adds regression coverage for 31-day-old and 451-message backlogs. Merge readinessKeep this PR open for normal maintainer review. The focused change removes a documented silent-loss path for accepted WhatsApp work, preserves bounded retention for terminal states, and the supplied Testbox evidence exercises the production monitor against SQLite; the remaining gate is refresh against current Priority: P1 Review scores
Verification
How this fits togetherWhatsApp stores accepted inbound messages in the shared durable channel-ingress queue before agent dispatch. The ingress monitor claims those pending rows for delivery and separately prunes completed or failed replay-guard history. flowchart LR
A[WhatsApp inbound message] --> B[Durable ingress queue]
B --> C[Pending accepted work]
C --> D[Ingress monitor]
D --> E[Agent dispatch]
E --> F[Completed or failed record]
F --> G[Bounded terminal retention]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -2, Tests +106. Total +104 across 2 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the narrow plugin-owned change once rebased or merge-refreshed against current Do we have a high-confidence way to reproduce the issue? No independent current-main run was available in this read-only review, but the reported loss mechanism is source-reproducible through the production ingress monitor and SQLite-backed queue tests added here. Is this the best way to solve the issue? Yes. Removing only the WhatsApp pending-retention overrides fixes the owner-local deletion policy while retaining bounded completed and failed replay-guard history; an arbitrary pending cap would again delete accepted work. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cc48aef14355. 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
History |
|
Merged via squash.
|
… waiting (openclaw#116179) * fix(whatsapp): silently drops inbound messages when more than 450 are waiting WhatsApp asked the shared ingress monitor to enforce a 450-entry cap and a 30-day TTL on pending durable ingress rows. Pending rows are undelivered work, not history, and the monitor runs retention before its first claim, so an account holding 451 accepted messages lost the oldest one to a hard DELETE before it could ever be dispatched. Loss scaled linearly with backlog depth and left no tombstone, no failure record, and no retained payload. Drop pendingTtlMs and pendingMaxEntries from the WhatsApp retention config. Completed and failed retention is unchanged so on-disk history stays bounded, and the config now matches every other channel on the shared monitor, whose defaults cover completed and failed only. The two values were carried over mechanically from the pre-SQLite openKeyedStore replay-guard cache in 4095b1e and inlined verbatim in openclaw#115824. Add regression coverage driving the real monitor and the real SQLite ingress queue over 451 accepted records. * test(whatsapp): cover pending ingress retention --------- Co-authored-by: Vincent Koc <[email protected]>
Related: #50563
Related: #85506
What Problem This Solves
WhatsApp durably accepts each inbound
messages.upsertbefore agent dispatch, but its shared ingress monitor was configured to hard-delete pending rows after 30 days or above 450 entries.Pending rows are accepted, undelivered work. The monitor prunes before its first claim, so a restart with 451 queued messages deleted the oldest message before dispatch. A pending row older than 30 days was deleted the same way. Both paths removed the payload and durable identity without a tombstone, failure record, or warning.
Why This Change Was Made
Remove only WhatsApp's
pendingTtlMsandpendingMaxEntriesoverrides. Completed and failed replay guards remain bounded:This is the correct plugin-owner boundary. Shared core is enforcing an explicit pruning API, and all 20 sibling shared-monitor adapters omit pending retention. The fix does not add configuration, change the SQLite schema, or weaken terminal replay-guard retention.
The limits originated in the pre-specialized-ingress-queue WhatsApp durable receive journal backed by the generic SQLite plugin-state keyed store. PR #85506 introduced the 450-entry/30-day pending journal,
b0679d1f13dcarried those bounds intochannel_ingress_events, and #115824 later inlined them. The predecessor was durable accepted work, not a pre-SQLite replay-guard cache.User Impact
Accepted WhatsApp messages remain recoverable until dispatch, permanent failure, or explicit operator action. Backlogs above 450 and pending work older than 30 days no longer lose messages silently.
No migration or configuration change is required.
Evidence
The regression suite uses the production
createWhatsAppIngressMonitorand the real SQLite-backed ingress queue.Legacy limits restored:
msg-000was deletedPatched behavior:
Focused Testbox proof:
Additional proof:
pnpm check:changed: passed, including formatting, plugin/API boundaries, dead-code scans, extension and extension-test typechecks, lint, database-first guard, and import-cycle checksgit diff --check: passedTesting