























@@ -119,6 +119,7 @@ describe("deliverDiscordReply", () => {
119119textLimit: 2000,
120120replyToId: "reply-1",
121121replyToMode: "all",
122+kind: "final",
122123});
123124124125const params = firstDeliverParams();
@@ -151,10 +152,30 @@ describe("deliverDiscordReply", () => {
151152 runtime,
152153 cfg,
153154textLimit: 2000,
155+kind: "final",
154156}),
155157).rejects.toThrow("discord final reply produced no delivered message for channel:101");
156158});
157159160+it("preserves explicit tool progress payloads at the tool delivery boundary", async () => {
161+await deliverDiscordReply({
162+replies: [{ text: "🛠️ Exec: `echo visible`" }],
163+target: "channel:101",
164+token: "token",
165+accountId: "default",
166+ runtime,
167+ cfg,
168+textLimit: 2000,
169+kind: "tool",
170+});
171+172+expect(sendDurableMessageBatchMock).toHaveBeenCalledWith(
173+expect.objectContaining({
174+payloads: [{ text: "🛠️ Exec: `echo visible`" }],
175+}),
176+);
177+});
178+158179it("strips internal execution trace lines at the final Discord send boundary", async () => {
159180await deliverDiscordReply({
160181replies: [
@@ -177,6 +198,7 @@ describe("deliverDiscordReply", () => {
177198 runtime,
178199 cfg,
179200textLimit: 2000,
201+kind: "final",
180202});
181203182204expect(firstDeliverParams().payloads).toEqual([{ text: "Visible reply." }]);
@@ -196,6 +218,7 @@ describe("deliverDiscordReply", () => {
196218 runtime,
197219 cfg,
198220textLimit: 2000,
221+kind: "final",
199222});
200223201224expect(firstDeliverParams().payloads).toEqual([
@@ -235,6 +258,7 @@ describe("deliverDiscordReply", () => {
235258 runtime,
236259 cfg,
237260textLimit: 2000,
261+kind: "final",
238262});
239263240264expect(firstDeliverParams().payloads).toEqual([{ channelData, text: undefined }]);
@@ -264,6 +288,7 @@ describe("deliverDiscordReply", () => {
264288 runtime,
265289 cfg,
266290textLimit: 2000,
291+kind: "final",
267292});
268293269294expect(firstDeliverParams().payloads).toEqual([{ presentation, text: undefined }]);
@@ -280,6 +305,7 @@ describe("deliverDiscordReply", () => {
280305 runtime,
281306 cfg,
282307textLimit: 2000,
308+kind: "final",
283309});
284310285311expect(firstDeliverParams().payloads).toEqual([{ text }]);
@@ -301,6 +327,7 @@ describe("deliverDiscordReply", () => {
301327 runtime,
302328 cfg,
303329textLimit: 2000,
330+kind: "final",
304331});
305332306333expect(firstDeliverParams().payloads).toEqual([{ text }]);
@@ -334,6 +361,7 @@ describe("deliverDiscordReply", () => {
334361maxLinesPerMessage: 7,
335362tableMode: "off",
336363chunkMode: "newline",
364+kind: "final",
337365});
338366339367expect(firstDeliverParams().cfg).toBe(baseCfg);
@@ -363,6 +391,7 @@ describe("deliverDiscordReply", () => {
363391textLimit: 2000,
364392replyToMode: "off",
365393mediaLocalRoots: ["/tmp/openclaw-media"],
394+kind: "final",
366395});
367396368397const params = firstDeliverParams();
@@ -381,6 +410,7 @@ describe("deliverDiscordReply", () => {
381410 cfg,
382411textLimit: 2000,
383412replyToId: "reply-1",
413+kind: "final",
384414});
385415386416const deps = firstDeliverParams().deps!;
@@ -429,6 +459,7 @@ describe("deliverDiscordReply", () => {
429459replyToId: "reply-1",
430460sessionKey: "agent:main:subagent:child",
431461 threadBindings,
462+kind: "final",
432463});
433464434465const params = firstDeliverParams();
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。