refactor(channels): share turn dispatch results

This commit is contained in:
Peter Steinberger
2026-04-30 02:58:31 +01:00
parent f94d970cee
commit 02ebac6250
21 changed files with 380 additions and 68 deletions

View File

@@ -3,6 +3,7 @@ import {
evaluateSupplementalContextVisibility,
resolveChannelContextVisibilityMode,
} from "openclaw/plugin-sdk/context-visibility-runtime";
import { hasFinalInboundReplyDispatch } from "openclaw/plugin-sdk/inbound-reply-dispatch";
import type { GetReplyOptions } from "openclaw/plugin-sdk/reply-runtime";
import {
loadSessionStore,
@@ -1963,7 +1964,7 @@ export function createMatrixRoomMessageHandler(params: MatrixMonitorHandlerParam
if (isRoom && triggerSnapshot) {
roomHistoryTracker.consumeHistory(_route.agentId, roomId, triggerSnapshot, _messageId);
}
if (!queuedFinal) {
if (!hasFinalInboundReplyDispatch({ queuedFinal, counts })) {
await commitInboundEventIfClaimed();
return;
}