


















@@ -2090,6 +2090,58 @@ describe("dispatchReplyFromConfig", () => {
20902090expect(dispatcher.sendFinalReply).not.toHaveBeenCalled();
20912091});
209220922093+it("suppresses channel-owned room-event progress callbacks while source delivery is suppressed", async () => {
2094+setNoAbort();
2095+sessionStoreMocks.currentEntry = {
2096+verboseLevel: "off",
2097+};
2098+const cfg = automaticGroupReplyConfig;
2099+const dispatcher = createDispatcher();
2100+const ctx = buildTestCtx({
2101+Provider: "telegram",
2102+Surface: "telegram",
2103+ChatType: "group",
2104+InboundEventKind: "room_event",
2105+From: "telegram:group:-100123",
2106+SessionKey: "agent:main:telegram:group:-100123",
2107+});
2108+const onToolStart = vi.fn();
2109+const onItemEvent = vi.fn();
2110+const onCommandOutput = vi.fn();
2111+2112+const replyResolver = async (
2113+_ctx: MsgContext,
2114+opts?: GetReplyOptions,
2115+_cfg?: OpenClawConfig,
2116+) => {
2117+await opts?.onToolStart?.({ name: "exec", phase: "start" });
2118+await opts?.onItemEvent?.({ itemId: "1", kind: "tool", progressText: "running exec" });
2119+await opts?.onCommandOutput?.({ phase: "end", name: "exec", status: "ok", exitCode: 0 });
2120+return { text: "done" } satisfies ReplyPayload;
2121+};
2122+2123+await dispatchReplyFromConfig({
2124+ ctx,
2125+ cfg,
2126+ dispatcher,
2127+ replyResolver,
2128+replyOptions: {
2129+sourceReplyDeliveryMode: "message_tool_only",
2130+suppressDefaultToolProgressMessages: true,
2131+allowProgressCallbacksWhenSourceDeliverySuppressed: true,
2132+ onToolStart,
2133+ onItemEvent,
2134+ onCommandOutput,
2135+},
2136+});
2137+2138+expect(onToolStart).not.toHaveBeenCalled();
2139+expect(onItemEvent).not.toHaveBeenCalled();
2140+expect(onCommandOutput).not.toHaveBeenCalled();
2141+expect(dispatcher.sendToolResult).not.toHaveBeenCalled();
2142+expect(dispatcher.sendFinalReply).not.toHaveBeenCalled();
2143+});
2144+20932145it("exposes live tool-summary state to reply_dispatch hooks", () => {
20942146let shouldSendToolSummaries = false;
20952147const event = dispatchFromConfigTesting.createReplyDispatchEvent({
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。