@@ -2154,12 +2154,12 @@ describe("processDiscordMessage draft streaming", () => {
|
2154 | 2154 | expect(deliverDiscordReply).not.toHaveBeenCalled(); |
2155 | 2155 | }); |
2156 | 2156 | |
2157 | | -it("streams Discord tool progress for coding-profile message-tool-only guild replies", async () => { |
2158 | | -const draftStream = createMockDraftStreamForTest(); |
2159 | | - |
| 2157 | +it("keeps Discord tool progress private for coding-profile message-tool-only guild replies", async () => { |
2160 | 2158 | dispatchInboundMessage.mockImplementationOnce(async (params?: DispatchInboundParams) => { |
2161 | 2159 | expect(params?.replyOptions?.sourceReplyDeliveryMode).toBe("message_tool_only"); |
2162 | | -expect(params?.replyOptions?.allowProgressCallbacksWhenSourceDeliverySuppressed).toBe(true); |
| 2160 | +expect( |
| 2161 | +params?.replyOptions?.allowProgressCallbacksWhenSourceDeliverySuppressed, |
| 2162 | +).toBeUndefined(); |
2163 | 2163 | await params?.replyOptions?.onToolStart?.({ name: "exec", phase: "start" }); |
2164 | 2164 | await params?.replyOptions?.onItemEvent?.({ progressText: "exec done" }); |
2165 | 2165 | return createNoQueuedDispatchResult(); |
@@ -2179,7 +2179,36 @@ describe("processDiscordMessage draft streaming", () => {
|
2179 | 2179 | await runProcessDiscordMessage(ctx); |
2180 | 2180 | |
2181 | 2181 | expect(getLastDispatchReplyOptions()?.sourceReplyDeliveryMode).toBe("message_tool_only"); |
2182 | | -expect(draftStream.update).toHaveBeenCalledWith("Pinching\n\n🛠️ Exec\n• exec done"); |
| 2182 | +expect(createDiscordDraftStream).not.toHaveBeenCalled(); |
| 2183 | +expect(deliverDiscordReply).not.toHaveBeenCalled(); |
| 2184 | +}); |
| 2185 | + |
| 2186 | +it("preserves explicitly enabled status reactions without exposing tool progress drafts", async () => { |
| 2187 | +dispatchInboundMessage.mockImplementationOnce(async (params?: DispatchInboundParams) => { |
| 2188 | +expect(params?.replyOptions?.sourceReplyDeliveryMode).toBe("message_tool_only"); |
| 2189 | +expect(params?.replyOptions?.allowProgressCallbacksWhenSourceDeliverySuppressed).toBe(true); |
| 2190 | +expect(params?.replyOptions?.suppressDefaultToolProgressMessages).toBe(true); |
| 2191 | +await params?.replyOptions?.onToolStart?.({ name: "exec", phase: "start" }); |
| 2192 | +return createNoQueuedDispatchResult(); |
| 2193 | +}); |
| 2194 | + |
| 2195 | +const ctx = await createBaseContext({ |
| 2196 | +cfg: { |
| 2197 | +tools: { profile: "coding" }, |
| 2198 | +messages: { |
| 2199 | +ackReaction: "👀", |
| 2200 | +groupChat: { visibleReplies: "message_tool" }, |
| 2201 | +statusReactions: { enabled: true, timing: { debounceMs: 0 } }, |
| 2202 | +}, |
| 2203 | +session: { store: "/tmp/openclaw-discord-process-test-sessions.json" }, |
| 2204 | +}, |
| 2205 | +route: BASE_CHANNEL_ROUTE, |
| 2206 | +}); |
| 2207 | + |
| 2208 | +await runProcessDiscordMessage(ctx); |
| 2209 | + |
| 2210 | +expect(getReactionEmojis()).toContain(DEFAULT_EMOJIS.done); |
| 2211 | +expect(createDiscordDraftStream).not.toHaveBeenCalled(); |
2183 | 2212 | expect(deliverDiscordReply).not.toHaveBeenCalled(); |
2184 | 2213 | }); |
2185 | 2214 | |
|