Repository navigation
fix(whatsapp): queued messages show an error reaction after successful handling - #172771
Conversation
|
ClawSweeper reviews are opt-in for maintainers. If a review is required, finish the work and validation first, then comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2932c547ec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1f4e965e63
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8defedd969
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 370c2b3fde
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b622386a99
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb4d5ee7a0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…sapp-status-reaction-queued-message
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 54a66ba618
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…whatsapp-status-reaction-queued-message
…whatsapp-status-reaction-queued-message
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR settles queued WhatsApp reactions from source delivery outcomes and handles cancellation, eviction, and unconfirmed transport custody. Example: With status reactions enabled, message B arrives while message A is running and receives a queued follow-up reply.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR addresses a current WhatsApp reaction bug, and the reviewed head has no actionable correctness findings. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherWhatsApp inbound dispatch supplies source-bound feedback callbacks to the shared follow-up queue, whose execution, delivery, and cleanup owners report facts back to the original message's reaction controller. flowchart TD
A[WhatsApp inbound message] --> B[Inbound reply plan]
B --> C[Shared follow-up queue]
C --> D[Agent execution]
D --> E[Source delivery owner]
C --> F[Cancellation and eviction cleanup]
E --> G[Original message reaction]
F --> G
Technical reviewBest possible solution: Use the existing source correlation to settle queued reactions after delivery, preserving immediate failures and the accepted neutral transport fallback. Do we have a high-confidence way to reproduce the issue? Yes at source level: accepted deferred dispatch can return without immediate delivery, while current main maps that absence to an error reaction; the reporter also supplies release-specific steps and reaction logs. Is this the best way to solve the issue? The implementation uses the existing queue, delivery, and reaction owners, retains source identity through collection and summaries, and avoids adding durable reaction machinery for the explicitly accepted neutral fallback. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cd3eb90f8752. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +108, Tests +305, Docs +19. Total +432 across 19 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 15, 2026, 4:29 AM ET / 08:29 UTC. |
|
Merged via squash.
|
Name the reply-plan return through existing public SDK contracts so the queued-reaction changes in #172771 (774f7ed) do not expose the private PLUGIN_COMMAND_DISPATCH symbol during package declaration emission. Extract the equivalent annotation from #172883. Keep the return contract and existing input aliases in a type-only sibling to avoid growing the oversized implementation. The dependency refresh can rebase over this repair. Runtime JavaScript and queued-reaction behavior are unchanged.
…l handling (openclaw#172771) * fix(whatsapp): follow queued message outcomes in status reactions * fix(whatsapp): report queued message eviction in status reactions * fix(whatsapp): wait for queued reply delivery before success * fix: preserve separate queued delivery outcome ownership * fix(whatsapp): settle queued reactions after terminal admission skips * fix(whatsapp): retain reaction settlement through queue summarization * fix(whatsapp): settle summarized follow-up source reactions * test: distinguish canceled summary cleanup from execution * test: expect aborted summary cleanup without replay * fix(whatsapp): distinguish stopped turns from pending deliveries * fix(whatsapp): clear reactions after transport custody handoff
Name the reply-plan return through existing public SDK contracts so the queued-reaction changes in openclaw#172771 (7ebc6d0) do not expose the private PLUGIN_COMMAND_DISPATCH symbol during package declaration emission. Extract the equivalent annotation from openclaw#172883. Keep the return contract and existing input aliases in a type-only sibling to avoid growing the oversized implementation. The dependency refresh can rebase over this repair. Runtime JavaScript and queued-reaction behavior are unchanged.
Complete the consumer migrations from openclaw#172887, openclaw#172992, openclaw#172771 and openclaw#172989. Keep local schemas and callback types private and remove redundant barrel exports. Session sharing authority remains in its policy owner and is still enforced by production callers.
Fixes #172708
What Problem This Solves
Fixes WhatsApp showing the wrong final reaction when a message arrives during an active run and is handled by a queued follow-up.
User Impact
Queued messages keep their acknowledgment until their follow-up settles delivery. They show ✅ only when a reply was visibly delivered to their source; a settled turn with no visible reply, including silent or
NO_REPLYturns, shows ❌ just like direct dispatch. Execution failures, terminal admission skips, Stop cancellations, and queue-cap rejection or eviction show ❌ immediately, even if a later error notice is delivered. Collected and summarized messages retain their individual reaction targets; evicting a compacted summary source also reports failure. When transport retains an unconfirmed send, the reaction is cleared to neutral rather than leaving permanent activity or claiming success/failure. No configuration change or migration is needed.Why This Change Was Made
The original dispatch has no visible reply when it hands a message to the queue. That handoff is not a failure, and successful agent execution is not proof of delivery either. WhatsApp now uses the existing source-bound queued delivery correlation to finalize its reaction after transport and presentation settlement. Core reports confirmed routing or dispatcher receipts, excluding failure notices delivered to a different channel. Deferred source retries retain ownership rather than reporting a terminal result; consumed pre-admission cancellations settle as failures instead of stranding the acknowledgment. Immediate execution or queue-cap failure cannot be replaced by later success. Summary compaction and synthetic overflow runs preserve source callbacks, and the cap owner reports actual eviction through the existing disposition notification. Canceled summary sources use the same no-execution cleanup as canceled ordinary entries. Stop settles the exact detached source correlations even if a callback throws. Pending routed or dispatcher delivery remains distinct from a terminal no-visible-reply result; an execution failure still wins immediately.
The existing optional
onFollowupQueueDispositioncallback is exposed through publicGetReplyOptions, and the existing delivery-correlation cleanup receives an optional settlement argument. These documented, additive SDK changes carry queue-owned facts to the reaction owner; no new export, subpath, configuration, or schema is introduced. Existing no-argument correlation consumers remain compatible. Separate source-owned Gateway batches retain their own outcome owner and do not report an unverified visibility result through this callback. Direct steering without a source terminal/delivery callback remains acknowledged; this does not add a steering completion notification. The optional settlement now carriestransportPendingso the reaction owner can clear activity when transport takes custody. Source retries remain distinct and retain their correlation for the next queued run.Held-delivery decision: the durable queue has no generic source terminal-callback subscription.
DurableDeliveryCompletionsupports persisted conversation and pending-final owners;onDeliveryIntentreports identity, and live result commit hooks cannot survive recovery or report terminal failure. This uses the explicitly requested neutral fallback: clear the WhatsApp reaction at held/ambiguous transport handoff. A later retry success or terminal failure remains visible through the delivery owner but does not update the cleared reaction. Direct WhatsApp dispatch currently has no held-specific neutral state; its normal visible-reply and silent-turn behavior is unchanged. No new callback registry, polling, persistence field, schema, or durability semantics are added.Deferred-effect facts: account, chat, message ID, participant, and
fromMeremain the immutable admitted message target; emoji, eligibility, and configuration retain that message's feedback policy. Each reaction send or clear resolves the active account listener through the existing transport owner. Delivery visibility comes from the current follow-up's source route or dispatcher receipt. Stop notifications use only the cleanup owner's revalidated, detached source set, and callback errors cannot prevent lifecycle settlement. No new session binding lookup, paths, limits, authority, or retained Gateway handle is introduced.Production delta is +173/-65 (net +108); tests +377/-72; docs +19/-0. The standalone finalizer was removed. The remaining growth carries delivery settlement, receipt evidence, and Stop notification through the existing owners; unrelated deletion would not improve this fix.
Evidence
PR CI is the test gate per maintainer policy. It covers the WhatsApp boundary regressions, follow-up delivery/runner tests, production and test types, lint, formatting, and SDK boundary checks. Local tests, negative controls, typechecks, and live Gateway/Crabbox/Testbox proof were intentionally skipped per that policy; no leases were created.
Regression coverage includes:
waits for queued delivery before showing $emoji (visible=$visibleReplySent)— successful execution stays pending until delivery, including no-visible-reply failure.preserves queued delivery settled before the original dispatch finalizes.shows execution failure immediately and does not replace it with delivery success.keeps a deferred retry pending and matches direct dispatch for a settled silent turn.settles evicted summary sources and retains surviving delivery correlations— real enqueue/summary compaction with four sources at cap one. Existing queue regressions also verify synthetic-summary correlation handoff and canceled elided-source cleanup.retains pending transport ownership for $route / $fallback, anddistinguishes transport handoff from source retry ($kind, failed=$failed).leaves held delivery neutral after a later $outcome receiptcovers delivered and terminally failed receipts at the source-correlation boundary using the actual shared reaction controller. This tests neutral finality, not a durable queue replay or a new recovery callback.reports settled source visibility for $origin: $route / $fallback— real channel routing plus delivered, failed, transformed, and cross-channel fallback receipts.settles a terminal admission skip (%s) and releases its operation, plus already-aborted and active-lane deferral cases.settles source delivery correlations with visible=%s, plus the existing ordering regression extended to assert cleanup waits for the separate source owner and presentation settlement.The
queue.dedupe.test.tsretained-summary and elided-summary cancellation test oracles now require exactly one cleanup callback carrying the original, already-aborted source. The existing redelivery/deduplication and dormant-queue assertions remain; source inspection ofdropAbortedFollowupsand the runner's early-abort branch verifies that this is cleanup, not model execution.Changed-file oxlint with the repository/core config, oxfmt, and
git diff --checkpassed. Deslop completed. Fresh independent P0–P2 autoreview is scoped-clean with no actionable findings.Exact-head CI 38700231720 passed for
cfca9457191050a102ff9df797ed15205422eb23: 49 successful jobs, 26 skipped, no failures. The completed run and head were verified live withOCTOPOOL_FRESH=1. All selected test jobs, production/test typechecks, lint, formatting, baseline, and SDK boundary checks passed. No CI rerun was needed.The WhatsApp test job 116306984004 passed 82 tests across 11 WhatsApp files in 30.56 seconds. The new neutral-state regressions passed for a later delivered receipt (2 ms) and terminally failed receipt (9 ms). Local test wall time is not applicable because local tests were intentionally not run under maintainer policy. Live Gateway/Crabbox/Testbox proof was also intentionally skipped; no leases were created.
The held-transport review finding is addressed with the documented neutral fallback, and the review thread is resolved. ClawSweeper has no code findings. The PR remains open and ready; it has not been merged.