diff --git a/src/auto-reply/reply/dispatch-from-config.test.ts b/src/auto-reply/reply/dispatch-from-config.test.ts index 2a9c2dd41f4..d9e4709be64 100644 --- a/src/auto-reply/reply/dispatch-from-config.test.ts +++ b/src/auto-reply/reply/dispatch-from-config.test.ts @@ -894,96 +894,6 @@ describe("dispatchReplyFromConfig", () => { expect(dispatcher.sendFinalReply).toHaveBeenCalledTimes(1); }); - it("emits concise tool-start progress updates for direct sessions", async () => { - setNoAbort(); - const cfg = emptyConfig; - const dispatcher = createDispatcher(); - const ctx = buildTestCtx({ - Provider: "telegram", - ChatType: "direct", - }); - - const replyResolver = async ( - _ctx: MsgContext, - opts?: GetReplyOptions, - _cfg?: OpenClawConfig, - ) => { - await opts?.onToolStart?.({ name: "read", phase: "start" }); - await opts?.onToolStart?.({ name: "read", phase: "update" }); - await opts?.onToolStart?.({ name: "grep", phase: "start" }); - await opts?.onToolStart?.({ name: "exec", phase: "start" }); - return { text: "done" } satisfies ReplyPayload; - }; - - await dispatchReplyFromConfig({ ctx, cfg, dispatcher, replyResolver }); - - expect(dispatcher.sendToolResult).toHaveBeenNthCalledWith( - 1, - expect.objectContaining({ text: "Working: read" }), - ); - expect(dispatcher.sendToolResult).toHaveBeenNthCalledWith( - 2, - expect.objectContaining({ text: "Working: grep" }), - ); - expect(dispatcher.sendToolResult).toHaveBeenCalledTimes(2); - expect(dispatcher.sendFinalReply).toHaveBeenCalledWith({ text: "done" }); - }); - - it("prefers item-start progress updates for direct sessions", async () => { - setNoAbort(); - const cfg = emptyConfig; - const dispatcher = createDispatcher(); - const ctx = buildTestCtx({ - Provider: "telegram", - ChatType: "direct", - }); - - const replyResolver = async ( - _ctx: MsgContext, - opts?: GetReplyOptions, - _cfg?: OpenClawConfig, - ) => { - await opts?.onItemEvent?.({ - itemId: "tool:read-1", - kind: "tool", - title: "read config", - name: "read", - phase: "start", - status: "running", - }); - await opts?.onItemEvent?.({ - itemId: "tool:read-1", - kind: "tool", - title: "read config", - name: "read", - phase: "end", - status: "completed", - }); - await opts?.onItemEvent?.({ - itemId: "tool:grep-1", - kind: "tool", - title: "grep", - name: "grep", - phase: "start", - status: "running", - }); - return { text: "done" } satisfies ReplyPayload; - }; - - await dispatchReplyFromConfig({ ctx, cfg, dispatcher, replyResolver }); - - expect(dispatcher.sendToolResult).toHaveBeenNthCalledWith( - 1, - expect.objectContaining({ text: "Working: read" }), - ); - expect(dispatcher.sendToolResult).toHaveBeenNthCalledWith( - 2, - expect.objectContaining({ text: "Working: grep" }), - ); - expect(dispatcher.sendToolResult).toHaveBeenCalledTimes(2); - expect(dispatcher.sendFinalReply).toHaveBeenCalledWith({ text: "done" }); - }); - it("renders plain-text plan updates and concise approval progress for direct sessions", async () => { setNoAbort(); const cfg = emptyConfig; @@ -1058,7 +968,6 @@ describe("dispatchReplyFromConfig", () => { expect(dispatcher.sendToolResult).toHaveBeenCalledTimes(1); expect(dispatcher.sendFinalReply).toHaveBeenCalledWith({ text: "done" }); }); - it("delivers deterministic exec approval tool payloads for native commands", async () => { setNoAbort(); const cfg = emptyConfig; diff --git a/src/auto-reply/reply/dispatch-from-config.ts b/src/auto-reply/reply/dispatch-from-config.ts index 69aa281bc55..3cf334ec903 100644 --- a/src/auto-reply/reply/dispatch-from-config.ts +++ b/src/auto-reply/reply/dispatch-from-config.ts @@ -779,26 +779,6 @@ export async function dispatchReplyFromConfig(params: { }; return run(); }, - onToolStart: ({ name, phase }) => { - if (phase !== "start") { - return; - } - if (typeof name !== "string") { - return; - } - return maybeSendWorkingStatus(name); - }, - onItemEvent: ({ phase, name, title, kind }) => { - if (phase !== "start") { - return; - } - if (kind === "tool" && typeof name === "string" && name.trim()) { - return maybeSendWorkingStatus(name); - } - if (typeof title === "string") { - return maybeSendWorkingStatus(title); - } - }, onPlanUpdate: ({ phase, explanation, steps }) => { if (phase !== "update") { return;