
















@@ -31,6 +31,36 @@ Runtime delivery helpers are available from
3131`openclaw/plugin-sdk/channel-message-runtime` for monitor/send code paths that
3232are already doing asynchronous message I/O.
333334+New channel and plugin send code should use the message lifecycle helpers from
35+`openclaw/plugin-sdk/channel-message-runtime`: `sendDurableMessageBatch`,
36+`withDurableMessageSendContext`, or `deliverInboundReplyWithMessageSendContext`.
37+The older
38+`deliverOutboundPayloads(...)` helper in `openclaw/plugin-sdk/outbound-runtime`
39+is deprecated compatibility/runtime substrate for outbound internals, recovery,
40+and legacy adapters. Do not use it for new channel or plugin send paths.
41+42+`sendDurableMessageBatch(...)` returns an explicit lifecycle outcome:
43+44+- `sent` - at least one visible platform message was delivered.
45+- `suppressed` - no platform message should be treated as missing. Stable
46+ reasons include `cancelled_by_message_sending_hook`,
47+`empty_after_message_sending_hook`, `no_visible_payload`,
48+`adapter_returned_no_identity`, and legacy `no_visible_result`.
49+- `partial_failed` - at least one platform message was delivered before a later
50+ payload or side effect failed. The result includes the delivered receipt prefix
51+ plus the failure.
52+- `failed` - no platform receipt was produced.
53+54+Use `payloadOutcomes` when a batch mixes sent, suppressed, and failed payloads.
55+Do not infer hook cancellation by checking whether the old direct-delivery array
56+is empty.
57+58+Compatibility dispatchers that still need the buffered reply dispatcher should
59+build reply-prefix options with `createChannelMessageReplyPipeline(...)` from
60+`openclaw/plugin-sdk/channel-message`, then call the runtime's
61+`channel.turn.runPrepared(...)`. That keeps session recording and dispatch
62+ordering on the shared turn lifecycle without adding another public turn wrapper.
63+3464## Minimal adapter
35653666Most new channel plugins can start with a small adapter:
@@ -124,8 +154,10 @@ tool send, implement `actions.prepareSendPayload(...)` instead of sending from
124154`prepareSendPayload(...)` receives the normalized core `ReplyPayload` plus the
125155full action context. Return a payload with channel-specific data in
126156`payload.channelData.<channel>` and let core call `sendMessage(...)`,
127-`deliverOutboundPayloads(...)`, the write-ahead queue, message-sending hooks,
128-retry, recovery, and ack cleanup.
157+the message lifecycle runtime, the write-ahead queue, message-sending hooks,
158+retry, recovery, and ack cleanup. The lifecycle runtime may call
159+`deliverOutboundPayloads(...)` internally as compatibility substrate, but channel
160+plugins should not call it directly for new send behavior.
129161130162Return `null` only when the send cannot be represented as a durable payload, for
131163example because it contains a non-serializable component factory. Core will keep
@@ -390,17 +422,21 @@ surface.
390422These APIs remain importable for third-party compatibility. Do not use them for
391423new channel code.
392424393-| Deprecated API | Replacement |
394-| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
395-| `openclaw/plugin-sdk/channel-reply-pipeline` | `openclaw/plugin-sdk/channel-message` |
396-| `createChannelTurnReplyPipeline(...)` | `createChannelMessageReplyPipeline(...)` for compatibility dispatchers, or a `message` adapter for new channel code |
397-| `deliverDurableInboundReplyPayload(...)` | `deliverInboundReplyWithMessageSendContext(...)` from `openclaw/plugin-sdk/channel-message-runtime` |
398-| `dispatchInboundReplyWithBase(...)` | `dispatchChannelMessageReplyWithBase(...)` only for compatibility dispatchers |
399-| `recordInboundSessionAndDispatchReply(...)` | `recordChannelMessageReplyDispatch(...)` only for compatibility dispatchers |
400-| `resolveChannelSourceReplyDeliveryMode(...)` | `resolveChannelMessageSourceReplyDeliveryMode(...)` |
401-| `deliverFinalizableDraftPreview(...)` | `defineFinalizableLivePreviewAdapter(...)` plus `deliverWithFinalizableLivePreviewAdapter(...)` |
402-| `DraftPreviewFinalizerDraft` | `LivePreviewFinalizerDraft` |
403-| `DraftPreviewFinalizerResult` | `LivePreviewFinalizerResult` |
425+| Deprecated API | Replacement |
426+| -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
427+| `openclaw/plugin-sdk/channel-reply-pipeline` | `openclaw/plugin-sdk/channel-message` |
428+| `createChannelTurnReplyPipeline(...)` | `createChannelMessageReplyPipeline(...)` for compatibility dispatchers, or a `message` adapter for new channel code |
429+| `buildChannelMessageReplyDispatchBase(...)` | `createChannelMessageReplyPipeline(...)` plus `channel.turn.runPrepared(...)`, or a `message` adapter for new channel code |
430+| `dispatchChannelMessageReplyWithBase(...)` | `createChannelMessageReplyPipeline(...)` plus `channel.turn.runPrepared(...)`, or a `message` adapter for new channel code |
431+| `recordChannelMessageReplyDispatch(...)` | `createChannelMessageReplyPipeline(...)` plus `channel.turn.runPrepared(...)`, or a `message` adapter for new channel code |
432+| `deliverOutboundPayloads(...)` | `sendDurableMessageBatch(...)` or `deliverInboundReplyWithMessageSendContext(...)` from `channel-message-runtime` |
433+| `deliverDurableInboundReplyPayload(...)` | `deliverInboundReplyWithMessageSendContext(...)` from `openclaw/plugin-sdk/channel-message-runtime` |
434+| `dispatchInboundReplyWithBase(...)` | `createChannelMessageReplyPipeline(...)` plus `channel.turn.runPrepared(...)`, or a `message` adapter for new channel code |
435+| `recordInboundSessionAndDispatchReply(...)` | `createChannelMessageReplyPipeline(...)` plus `channel.turn.runPrepared(...)`, or a `message` adapter for new channel code |
436+| `resolveChannelSourceReplyDeliveryMode(...)` | `resolveChannelMessageSourceReplyDeliveryMode(...)` |
437+| `deliverFinalizableDraftPreview(...)` | `defineFinalizableLivePreviewAdapter(...)` plus `deliverWithFinalizableLivePreviewAdapter(...)` |
438+| `DraftPreviewFinalizerDraft` | `LivePreviewFinalizerDraft` |
439+| `DraftPreviewFinalizerResult` | `LivePreviewFinalizerResult` |
404440405441Compatibility dispatchers can still use `createReplyPrefixContext(...)`,
406442`createReplyPrefixOptions(...)`, and `createTypingCallbacks(...)` through the
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。