Repository navigation
fix(delivery): preserve suppressed send outcomes - #122421
Conversation
Preserve authoritative durable-send suppression outcomes so task, subagent, and exec followups no longer report false delivery or duplicate ambiguous adapter dispatches.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs changes before merge. Reviewed August 12, 2026, 12:11 AM ET / 04:11 UTC. ClawSweeper reviewWhat this changesThe PR preserves durable-send suppression reasons so task, subagent, and exec follow-up callers no longer report suppressed notifications as delivered. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked by patch quality or review findings - 6 items remain Keep this PR open: its state-change path retries an adapter dispatch that may already be visible, creating the duplicate-send outcome the patch otherwise avoids. Priority: P1 Review scores
Verification
How this fits togetherOpenClaw’s outbound message API converts durable channel-send results into a common result consumed by task and agent notification owners. Those owners then record delivery, queue a fallback, or stop to avoid duplicating an ambiguous send. flowchart LR
A[Task or agent completion] --> B[Outbound message API]
B --> C[Durable channel sender]
C --> D{Delivery outcome}
D -->|Sent| E[Record delivery]
D -->|Intentional suppression| F[Safe owner fallback]
D -->|Ambiguous adapter result| G[Record non-retry ambiguity]
F --> H[Task or agent state]
G --> H
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +52, Tests +155. Total +207 across 10 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Map adapter_returned_no_identity in task state-change delivery to an ambiguity diagnostic that advances the event cursor, while retaining retries for intentional suppression; no clear net-neutral shared refactor exists because the three callers own distinct fallback policies. Do we have a high-confidence way to reproduce the issue? Yes—source reproducible: an adapter result with no identity reaches the new throw at src/tasks/task-registry-delivery.ts:454, the catch retains lastNotifiedEventAt, and the next call re-sends the same event. Is this the best way to solve the issue? No—the shared typed projection is the right boundary, but the task state-change caller must treat adapter ambiguity as non-retryable, matching the existing durable and route-reply contract. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 630aac9b25ae. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Derive the outbound projection from the existing durable batch result union so the repair does not change the public plugin SDK contract.
Advance the state-change event cursor after an adapter returns no identity so a possibly visible progress notification is not sent twice; intentional suppression remains retryable.
|
Land-ready evidence for
ClawSweeper rank-up moves: all six applied. Adapter ambiguity now advances the task state-change cursor without retry; the duplicate-send merge risk is removed; intentional suppression remains retryable; the narrow owner repair is in place; the repeated-event regression proves one send; and the positive production delta is justified without adding an unnecessary shared abstraction. Known proof gap: no live-channel proof is claimed. This deterministic repair is proven at the outbound and consuming owner boundaries plus exact-head CI. |
|
Merged via squash.
|
* fix(delivery): preserve suppressed send outcomes Preserve authoritative durable-send suppression outcomes so task, subagent, and exec followups no longer report false delivery or duplicate ambiguous adapter dispatches. * fix(delivery): keep suppression reason internal Derive the outbound projection from the existing durable batch result union so the repair does not change the public plugin SDK contract. * fix(delivery): avoid retrying ambiguous task updates Advance the state-change event cursor after an adapter returns no identity so a possibly visible progress notification is not sent twice; intentional suppression remains retryable.
What Problem This Solves
Fixes an issue where background task, subagent, and exec approval notifications could be reported as delivered after durable outbound sending had explicitly suppressed them. That false success could silently lose the notification; an ambiguous adapter dispatch could also invite a duplicate fallback.
Why This Change Was Made
The durable batch sender already records the authoritative aggregate suppression reason, but
sendMessagedropped it when projectingMessageSendResult. This change preserves that typed reason at the outbound boundary and lets each owning caller map it into its existing domain outcome: intentional suppression may use the existing session fallback or retry path, whileadapter_returned_no_identityis recorded as ambiguous/non-success without attempting a duplicate direct send. Task state changes advance their event cursor after adapter ambiguity but retain retry for intentional suppression. Callback-confirmed delivery still wins.Gateway callers that return success without
deliveryStatusremain compatible and continue to be treated as delivered. Subagent lifecycle cleanup is unchanged because it already consumesintentional_non_deliveryandambiguousoutcomes correctly; the defect was in producing those outcomes from raw-text direct delivery.No config, protocol, dependency, storage, changelog, version, package, or release surface changes. There is no exact code overlap with #121174 or #121180; #121180 is behavior-adjacent only upstream of outbound delivery.
User Impact
OpenClaw no longer claims successful delivery when durable sending explicitly suppressed a task, subagent, or exec followup. Intentional non-delivery can follow the established fallback path, while an adapter dispatch with no returned identity remains visibly ambiguous and avoids a potentially duplicate send.
Evidence
src/infra/outbound/message.test.ts15 passed;src/tasks/task-registry.test.ts127 passed;src/agents/subagents/announce/subagent-announce-delivery.test.ts161 passed;src/agents/bash-tools.exec-approval-followup.test.ts39 passed. Total: 342 passed. The adapter-ambiguity retry regression demonstrably failed on the old task branch with 2 sends instead of 1, then passed after the owner fix; intentional suppression still sends twice across two attempts.coreandcoreTests. Targeted oxfmt and oxlint are clean;git diff --checkis clean.tbx_01kzt40s2874f3gaw5nan5x8f8: https://github.com/openclaw/openclaw/actions/runs/31563709500. The final task ambiguity correction passedpnpm tsgo:core,pnpm tsgo:core:test, and targeted oxfmt/oxlint (exit 0). The preceding final-tree API prooftbx_01kzt2q478rysj2bskjv6d06fx/ https://github.com/openclaw/openclaw/actions/runs/31562487032 passed the plugin SDK API baseline plus the same type/format/lint gates.