Skip to content

fix(whatsapp): batch rapid messages without reordering replies - #112001

Merged
fuller-stack-dev merged 2 commits into
mainfrom
fix/whatsapp-inbound-debounce-adoption
Sep 18, 2026
Merged

fuller-stack-dev merged 2 commits into
mainfrom
fix/whatsapp-inbound-debounce-adoption

Conversation

@mcaxtr

@mcaxtr mcaxtr commented Jul 21, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes rapid WhatsApp messages missing their debounce window and group messages arriving out of order when another sender interrupts a buffered batch.

User Impact

Follow-up messages can enter the reply lane promptly, while messages from different group participants remain ordered and are never combined under the wrong sender. Durable claims and read receipts still wait for the appropriate adoption or completion.

No configuration changes, migrations, or user action are required.

Why This Change Was Made

Allow deferred debounce candidates to release the conversation lane without settling their individual durable claims. Use the existing conversation-wide debouncer ordering and end a batch when its sender changes.

Preserves the original fix and contributor credit from @mcaxtr, with caller alignment and group-ordering regression coverage added on this PR.

Evidence

  • 56 tests passed across durable receive, inbox delivery/deduplication, debounce policy, and socket lifecycle suites.
  • Three new group-ordering regressions failed before the ordering fix and passed afterward. Coverage includes quoted and buffered interruptions, separate sender attribution, claim/read-receipt settlement, and unrelated-conversation progress during held admission.
  • All 26 selected check stages passed, including isolated declaration/lint validation and extension production/test types.
  • Independent review found no actionable P0–P2 defects in the complete candidate.
  • Hosted CI passed on exact commit 5fc207c8dfa993fc4a36dc8435beffd0f43636fc.

Validation uses isolated source-level inbox and durable-queue fixtures; no live WhatsApp account or production Gateway was exercised.

@openclaw-barnacle openclaw-barnacle Bot added channel: whatsapp-web Channel integration: whatsapp-web size: L maintainer Maintainer-authored PR labels Jul 21, 2026
@mcaxtr
mcaxtr marked this pull request as ready for review July 21, 2026 01:40
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jul 21, 2026
@clawsweeper

clawsweeper Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 18, 2026, 7:24 PM ET / 23:24 UTC (Revision 11).

ClawSweeper review

What this changes

The WhatsApp plugin batches rapid same-sender messages while preserving conversation order, separating group participants, and retaining each message’s durable claim until adoption.

Merge readiness

✅ Ready for maintainer review

The earlier ordering and caller-assertion findings are resolved, with no new actionable defects found. This remains a useful fix absent from inspected main and the latest release; the overlapping open PR does not supersede its sender-ordering repair.

Priority: P2
Reviewed head: 5fc207c8dfa993fc4a36dc8435beffd0f43636fc

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with meaningful regression coverage and resolved prior findings; live validation is explicitly unclaimed.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate. Its production ingress/debounce owners are exercised through reported fixture tests, not live WhatsApp; related production traces support lane release but do not prove this head’s sender-ordering change.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate. Its production ingress/debounce owners are exercised through reported fixture tests, not live WhatsApp; related production traces support lane release but do not prove this head’s sender-ordering change.
Evidence reviewed 9 items Pinned change and review continuity: The verified introduced delta is base 19a209e to head 5fc207c. Comparing the earlier reviewed head shows the conversation-wide key and sender-boundary flush were added to address the prior ordering finding. The latest completed review at this same head had no findings.
Claim custody remains separate from lane occupancy: The plugin opts into the existing release-on-deferral contract. The shared drain removes deferred lane occupancy while retaining the active claim, lease refresh, stall watchdog, and adoption settlement; the delivery coordinator awaits enqueue before returning deferred.
Ordering repair uses the existing owner: The plugin flushes a pending batch before admitting a different sender. The shared debouncer reserves keyed execution slots and waits for admission, while separately tracking completion for shutdown. Existing lifecycle fan-in settles all source claims without changing their stored format.
Findings None None.
Security None None.

How this fits together

WhatsApp incoming messages enter a durable queue before the plugin batches them into agent turns. The shared ingress drain controls admission, while the debouncer preserves dispatch order and carries claim settlement into the reply lifecycle.

flowchart LR
  A[WhatsApp messages] --> B[Durable inbound queue]
  B --> C[Conversation admission]
  C --> D[Same sender batch]
  D --> E[Sender change or timer]
  E --> F[Ordered agent turns]
  F --> G[Claim settlement and read receipts]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +13, Tests +244. Total +257 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 2 22 9 +13
Tests 3 274 30 +244
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 296 39 +257

Review metrics

Metric Value Why it matters
Production versus regression coverage production net +13 lines; tests net +244 lines The small production increase implements sender-boundary tracking; the larger test delta protects ordering, claim custody, and shutdown behavior.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #119382
Summary: This PR repairs the reported WhatsApp debounce starvation and adds sender-ordering protection; overlapping work remains unmerged.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep batching in the existing WhatsApp adapter and shared debouncer, preserving conversation order, sender attribution, and independent durable claim settlement.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: configured same-chat bursts cannot share a debounce window while current main holds the ingress lane until adoption. This review did not execute a runtime reproduction.

Is this the best way to solve the issue?

Yes. The patch uses the existing lane-release contract and conversation ordering owner, adding sender-boundary flushing without new configuration, APIs, or storage changes.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against f85c70d38f2e.

Labels

Label justifications:

  • P2: This repairs configured WhatsApp burst batching and group ordering with a bounded channel-specific change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate. Its production ingress/debounce owners are exercised through reported fixture tests, not live WhatsApp; related production traces support lane release but do not prove this head’s sender-ordering change.

Evidence

What I checked:

  • Pinned change and review continuity: The verified introduced delta is base 19a209e to head 5fc207c. Comparing the earlier reviewed head shows the conversation-wide key and sender-boundary flush were added to address the prior ordering finding. The latest completed review at this same head had no findings. (extensions/whatsapp/src/inbound/message-debounce.ts:171, 5fc207c8dfa9)
  • Claim custody remains separate from lane occupancy: The plugin opts into the existing release-on-deferral contract. The shared drain removes deferred lane occupancy while retaining the active claim, lease refresh, stall watchdog, and adoption settlement; the delivery coordinator awaits enqueue before returning deferred. (src/channels/message/ingress-drain.ts:354, 5fc207c8dfa9)
  • Ordering repair uses the existing owner: The plugin flushes a pending batch before admitting a different sender. The shared debouncer reserves keyed execution slots and waits for admission, while separately tracking completion for shutdown. Existing lifecycle fan-in settles all source claims without changing their stored format. (extensions/whatsapp/src/inbound/message-debounce.ts:161, 5fc207c8dfa9)
  • Meaningful regression coverage: Reviewed tests cover quoted and buffered sender interruptions, sender attribution, unrelated-conversation progress during held admission, timestamp/receive-order batching, individual claim settlement, read receipts, and shutdown. The two previously incompatible caller assertions now match the intended batching and deferred-custody behavior. (extensions/whatsapp/src/monitor-inbox.debounce-policy.test.ts:72, 5fc207c8dfa9)
  • Still necessary on main: Fetched main still omits deferredLaneOccupancy in the WhatsApp monitor, inheriting the shared drain’s hold default. Its two affected production files match the pinned base. The documented messages.inbound setting therefore does not itself resolve the admission blockage. (extensions/whatsapp/src/inbound/durable-receive.ts:139, f85c70d38f2e)
  • Latest release also lacks the fix: The v2026.9.4 WhatsApp monitor likewise omits the lane-release option; this is not already-shipped cleanup. (extensions/whatsapp/src/inbound/durable-receive.ts, 3a9d69db306c)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • yetval: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • fuller-stack-dev: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-04T23:17:53.080Z sha 57c6edf :: found issues before merge. :: [P1] Port the concurrency change to the current inbound owners
  • reviewed 2026-08-15T12:21:30.766Z sha 57c6edf :: found issues before merge. :: [P1] Port the concurrency change to the current inbound owners
  • reviewed 2026-08-20T06:22:08.290Z sha 57c6edf :: found issues before merge. :: [P1] Port the concurrency change to the current inbound owners
  • reviewed 2026-08-26T07:38:20.925Z sha 57c6edf :: needs historical verification review before merge. :: [P1] Keep pending ingress records unbounded | [P1] Port the concurrency change to the current inbound owners
  • reviewed 2026-09-04T21:35:15.683Z sha 57c6edf :: blocked before merge. :: [P1] Port the batching change to the current inbound owners
  • reviewed 2026-09-15T02:32:17.255Z sha a7c5694 :: blocked before merge. :: [P1] Preserve group conversation order across sender-specific buffers
  • reviewed 2026-09-16T02:08:05.111Z sha 2ae6afe :: blocked before merge. :: [P1] Preserve group conversation order across sender-specific buffers
  • reviewed 2026-09-18T23:17:44.187Z sha 5fc207c :: needs maintainer review before merge. :: none

@mcaxtr
mcaxtr force-pushed the fix/whatsapp-inbound-debounce-adoption branch from ca5f979 to 57c6edf Compare July 22, 2026 04:04
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 31, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. label Aug 20, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 28, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. labels Sep 7, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. and removed merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Sep 15, 2026
@mcaxtr
mcaxtr force-pushed the fix/whatsapp-inbound-debounce-adoption branch from a7c5694 to 2ae6afe Compare September 16, 2026 02:01
@fuller-stack-dev fuller-stack-dev self-assigned this Sep 18, 2026
Retain per-message durable claims while admitting same-lane follow-ups. Flush batches at sender boundaries and preserve conversation admission order. Align caller regressions for combined follow-ups and deferred claim custody.

Integrate the tested main snapshot to retain the reviewed lifecycle context while preserving the original contributor commit.
@fuller-stack-dev

Copy link
Copy Markdown
Member

@clawsweeper re-review

Updated to 5fc207c8dfa993fc4a36dc8435beffd0f43636fc. The cross-sender ordering finding and both failing caller assertions are addressed, with three reproducing group-ordering regressions. The PR description now reflects the implementation and proof: 56 affected tests, 26 selected checks, and a clean independent review. Exact-head CI is running: https://github.com/openclaw/openclaw/actions/runs/35404638697

@clawsweeper

clawsweeper Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 18, 2026
@fuller-stack-dev
fuller-stack-dev merged commit 6131ca3 into main Sep 18, 2026
111 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the fix/whatsapp-inbound-debounce-adoption branch September 18, 2026 23:28
@fuller-stack-dev

Copy link
Copy Markdown
Member

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 18, 2026
…rent-main-20260918

* origin/main: (1925 commits)
  fix(ui): preserve person picker selection and profile photos (#152194)
  feat(meetings): summarize meetings during live capture (#151957)
  refactor(watch): share delivery status text formatting (#152228)
  fix(skills): detach idle reviews from foreground plugin scope (#152235)
  fix(mcp): stop cancelled question tests leaking into later cases (#152215)
  fix: show pasted text as compact chat chips (#151618)
  refactor(config): share diagnostic container scanning (#149099)
  fix(whatsapp): admit debounce candidates independently (#112001)
  fix(release): qualify 2026.7.34 frozen SDK (#152230)
  fix(sessions): notify Home about new sessions by default (#152068)
  fix(ui): open workspace links with spaces and emoji (#152179)
  fix(update): reconcile completed updates after interrupted verification (#152202)
  fix: reduce repeated update validation for large agent fleets (#151678)
  docs: clarify WebChat commentary attachment compatibility (#152225)
  fix(worktrees): keep provisioning inspection under the Git output cap (#150532)
  fix(ui): unify fullscreen widget menu typography (#152223)
  test(gateway): synchronize unstable task registry scans (#152213)
  fix: restore automation creation for remote administrators (#151291)
  improve: defer internal agent-turn execution imports until use (#151935)
  fix(agents): resume private child results in channel conversations (#152207)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: whatsapp-web Channel integration: whatsapp-web maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants