
























@@ -256,13 +256,17 @@ vi.mock("openclaw/plugin-sdk/channel-streaming", () => ({
256256};
257257},
258258formatChannelProgressDraftText: (params: {
259-entry?: { streaming?: { progress?: { label?: string; maxLines?: number } } };
259+entry?: { streaming?: { progress?: { label?: string | false; maxLines?: number } } };
260260lines: string[];
261-}) =>
262-[
263-params.entry?.streaming?.progress?.label ?? "Thinking",
261+}) => {
262+const label = params.entry?.streaming?.progress?.label;
263+return [
264+label === false ? undefined : (label ?? "Thinking"),
264265 ...params.lines.map((line) => `• ${line}`),
265-].join("\n"),
266+]
267+.filter((line): line is string => Boolean(line))
268+.join("\n");
269+},
266270resolveChannelProgressDraftMaxLines: (entry?: {
267271streaming?: { progress?: { maxLines?: number } };
268272}) => entry?.streaming?.progress?.maxLines ?? 8,
@@ -731,6 +735,29 @@ describe("dispatchPreparedSlackMessage preview fallback", () => {
731735expect(capturedReplyOptions?.onItemEvent).toBeDefined();
732736});
733737738+it("does not create a blank Slack progress draft when label and lines are disabled", async () => {
739+const draftStream = createDraftStreamStub();
740+createSlackDraftStreamMock.mockReturnValueOnce(draftStream);
741+mockedSlackStreamingMode = "progress";
742+mockedSlackDraftMode = "status_final";
743+mockedDispatchSequence = [];
744+mockedReplyOptionEvents = [
745+{ kind: "item", progressText: "tool one" },
746+{ kind: "item", progressText: "tool two" },
747+];
748+749+await dispatchPreparedSlackMessage(
750+createPreparedSlackMessage({
751+accountConfig: {
752+streaming: { mode: "progress", progress: { label: false, toolProgress: false } },
753+},
754+}),
755+);
756+757+expect(capturedReplyOptions?.suppressDefaultToolProgressMessages).toBe(true);
758+expect(draftStream.update).not.toHaveBeenCalled();
759+});
760+734761it("keeps standalone Slack tool progress when partial preview lines are disabled", async () => {
735762mockedSlackStreamingMode = "partial";
736763mockedSlackDraftMode = "replace";
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。