You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(delivery): disambiguate hook cancellations from delivery failures (#57766)
Enrich deliverOutboundPayloads return type from OutboundDeliveryResult[]
to DeliveryOutcome — carries cancelledCount and allCancelledByHook so
callers can distinguish intentional hook suppression from delivery failure.
Wrap mid-stream non-bestEffort throws in DeliveryError with
sentBeforeError to prevent blind retries that duplicate already-delivered
messages. Guard retryTransientDirectCronDelivery against DeliveryError
so partial sends are never retried in the cron direct-delivery path.
DeliveryError is detected via a local isDeliveryError(err) helper that
checks err.name + Array.isArray(err.sentBeforeError), with DeliveryError
imported as a type only. This keeps the heavy outbound delivery module
off delivery-dispatch.ts's cold-startup import graph (preserving the
existing loadDeliveryOutboundRuntime boundary) and stays defensive
against a third-party adapter throwing a same-named error.
Updates all 5 callers that use the return value; 9 fire-and-forget
callers need no changes. Test mocks updated to return DeliveryOutcome
shape.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ Docs: https://docs.openclaw.ai
18
18
- Plugins/doctor: avoid full-array sorting while selecting ClawHub search/archive results and bounded dreaming doctor entries. Thanks @shakkernerd.
19
19
- Agents/compaction: keep contributor diagnostics to a bounded top-three selection without sorting the full history. Thanks @shakkernerd.
20
20
- Sessions/UI: avoid full-array sorting while selecting ACPX leases, Google Meet calendar events, and latest chat sessions. Thanks @shakkernerd.
21
+
- Outbound delivery: enrich `deliverOutboundPayloads` to return a `DeliveryOutcome` (an `OutboundDeliveryResult[]` augmented with non-enumerable `cancelledCount` and `allCancelledByHook` metadata, fully back-compatible with existing array-shape consumers) and throw `DeliveryError` with `sentBeforeError` when a non-bestEffort send fails after some payloads were already delivered, so callers can distinguish hook-cancelled sends from delivery failures. Cron direct-delivery, gateway restart-sentinel, and the WAL queue cleanup path all short-circuit on `DeliveryError` and ack the queue entry instead of failing it, so a future drain/restart cannot replay the whole batch and duplicate the already-sent prefix. Fixes #57766.
21
22
- Telegram: preserve the channel-specific 10-option poll cap in the unified outbound adapter so over-limit polls are rejected before send. (#78762) Thanks @obviyus.
22
23
- Slack: route handled top-level channel turns in implicit-conversation channels to thread-scoped sessions when Slack reply threading is enabled, keeping the root turn and later thread replies on one OpenClaw session. (#78522) Thanks @zeroth-blip.
23
24
- Telegram: re-probe the primary fetch transport after repeated sticky fallback success so transient IPv4 or pinned-IP fallback promotion can recover without a gateway restart. Fixes #77088. (#77157) Thanks @MkDev11.
0 commit comments