























@@ -2179,7 +2179,7 @@ describe("dispatchPreparedSlackMessage preview fallback", () => {
21792179}),
21802180);
218121812182-expect(draftStream.forceNewMessage).toHaveBeenCalledTimes(1);
2182+expect(draftStream.forceNewMessage).not.toHaveBeenCalled();
21832183expect(draftStream.update).toHaveBeenLastCalledWith({
21842184text: ["Shelling", "• tool one", "• tool two"].join("\n"),
21852185blocks: [
@@ -2207,6 +2207,48 @@ describe("dispatchPreparedSlackMessage preview fallback", () => {
22072207expect(deliverRepliesMock).not.toHaveBeenCalled();
22082208});
220922092210+it("preserves text Slack progress lines after a draft boundary status update", async () => {
2211+const draftStream = createDraftStreamStub();
2212+createSlackDraftStreamMock.mockReturnValueOnce(draftStream);
2213+mockedSlackStreamingMode = "progress";
2214+mockedSlackDraftMode = "status_final";
2215+mockedDispatchSequence = [];
2216+mockedReplyOptionEvents = [
2217+{ kind: "item", progressText: "tool one" },
2218+{ kind: "item", progressText: "tool two" },
2219+{ kind: "assistant_start" },
2220+{ kind: "partial", text: "partial answer" },
2221+];
2222+2223+await dispatchPreparedSlackMessage(
2224+createPreparedSlackMessage({
2225+accountConfig: { streaming: { progress: { label: "Working" } } },
2226+}),
2227+);
2228+2229+expect(draftStream.forceNewMessage).not.toHaveBeenCalled();
2230+expect(draftStream.update).toHaveBeenLastCalledWith(
2231+["Working", "• tool one", "• tool two"].join("\n"),
2232+);
2233+});
2234+2235+it("forces a new draft message on assistant boundaries in partial mode", async () => {
2236+const draftStream = createDraftStreamStub();
2237+createSlackDraftStreamMock.mockReturnValueOnce(draftStream);
2238+mockedSlackStreamingMode = "partial";
2239+mockedSlackDraftMode = "replace";
2240+mockedDispatchSequence = [];
2241+mockedReplyOptionEvents = [
2242+{ kind: "partial", text: "first chunk" },
2243+{ kind: "assistant_start" },
2244+{ kind: "partial", text: "second chunk" },
2245+];
2246+2247+await dispatchPreparedSlackMessage(createPreparedSlackMessage({}));
2248+2249+expect(draftStream.forceNewMessage).toHaveBeenCalledTimes(1);
2250+});
2251+22102252it("can hide raw Slack command progress text by config", async () => {
22112253const draftStream = createDraftStreamStub();
22122254createSlackDraftStreamMock.mockReturnValueOnce(draftStream);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。