





















@@ -1,4 +1,5 @@
11import { randomUUID } from "node:crypto";
2+import { sanitizeQaBusToolCalls } from "openclaw/plugin-sdk/qa-channel-protocol";
23import {
34buildQaBusSnapshot,
45cloneMessage,
@@ -25,6 +26,7 @@ import type {
2526QaBusSearchMessagesInput,
2627QaBusStateSnapshot,
2728QaBusThread,
29+QaBusToolCall,
2830QaBusWaitForInput,
2931} from "./runtime-api.js";
3032@@ -115,8 +117,10 @@ export function createQaBusState() {
115117threadTitle?: string;
116118replyToId?: string;
117119attachments?: QaBusAttachment[];
120+toolCalls?: QaBusToolCall[];
118121}): QaBusMessage => {
119122const conversation = ensureConversation(params.conversation);
123+const toolCalls = sanitizeQaBusToolCalls(params.toolCalls);
120124const message: QaBusMessage = {
121125id: randomUUID(),
122126accountId: params.accountId,
@@ -130,6 +134,7 @@ export function createQaBusState() {
130134threadTitle: params.threadTitle,
131135replyToId: params.replyToId,
132136attachments: params.attachments?.map((attachment) => ({ ...attachment })) ?? [],
137+ ...(toolCalls ? { toolCalls } : {}),
133138reactions: [],
134139};
135140messages.set(message.id, message);
@@ -169,6 +174,7 @@ export function createQaBusState() {
169174threadTitle: input.threadTitle,
170175replyToId: input.replyToId,
171176attachments: input.attachments,
177+toolCalls: input.toolCalls,
172178});
173179pushEvent({
174180kind: "inbound-message",
@@ -191,6 +197,7 @@ export function createQaBusState() {
191197threadId: input.threadId ?? threadId,
192198replyToId: input.replyToId,
193199attachments: input.attachments,
200+toolCalls: input.toolCalls,
194201});
195202pushEvent({
196203kind: "outbound-message",
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。