22import { describe , expect , it , vi } from "vitest" ;
33import {
44 BASE_CHANNEL_ROUTE ,
5- createAutomaticSourceDeliveryContext ,
65 createBaseContext ,
76 createDiscordDraftStream ,
87 createMockDraftStream ,
@@ -19,6 +18,7 @@ import {
1918} from "./message-handler.process.test-harness.js" ;
2019import type { DispatchInboundParams } from "./message-handler.process.test-harness.js" ;
2120import {
21+ createAutomaticDraftContext ,
2222 createMockDraftStreamForTest ,
2323 expectFinalWithProgressReceipt ,
2424 expectFreshFinalText ,
@@ -45,7 +45,7 @@ async function runHookSafetyFinalReply(mode: (typeof PREVIEW_MODES)[number]) {
4545 await params ?. dispatcher . waitForIdle ( ) ;
4646 return { queuedFinal : true , counts : { final : 1 , tool : 0 , block : 0 } } ;
4747 } ) ;
48- const ctx = await createAutomaticSourceDeliveryContext ( {
48+ const ctx = await createAutomaticDraftContext ( {
4949 discordConfig : { streaming : { mode } } ,
5050 } ) ;
5151 await runProcessDiscordMessage ( ctx ) ;
@@ -88,7 +88,7 @@ describe("processDiscordMessage provider preview hook safety", () => {
8888 } ) ;
8989
9090 it ( "keeps explicitly disabled previews off without hooks" , async ( ) => {
91- const ctx = await createAutomaticSourceDeliveryContext ( {
91+ const ctx = await createAutomaticDraftContext ( {
9292 discordConfig : { streaming : { mode : "off" } } ,
9393 } ) ;
9494
@@ -104,7 +104,7 @@ describe("processDiscordMessage provider preview hook safety", () => {
104104 await params ?. dispatcher . sendFinalReply ( { text : "Hello" } ) ;
105105 return { queuedFinal : true , counts : { final : 1 , tool : 0 , block : 0 } } ;
106106 } ) ;
107- const ctx = await createAutomaticSourceDeliveryContext ( {
107+ const ctx = await createAutomaticDraftContext ( {
108108 cfg : { agents : { defaults : { blockStreamingDefault : "on" } } } ,
109109 discordConfig : { streaming : { mode : "partial" } } ,
110110 } ) ;
@@ -153,7 +153,7 @@ describe("processDiscordMessage draft streaming final delivery", () => {
153153 return { queuedFinal : true , counts : { final : 1 , tool : 0 , block : 0 } } ;
154154 } ) ;
155155
156- const ctx = await createAutomaticSourceDeliveryContext ( {
156+ const ctx = await createAutomaticDraftContext ( {
157157 discordConfig : { streaming : { mode : "partial" } , maxLinesPerMessage : 5 } ,
158158 cfg : {
159159 channels : { discord : { mentionAliases : { Sentinel : "1485891428809707651" } } } ,
@@ -172,7 +172,7 @@ describe("processDiscordMessage draft streaming final delivery", () => {
172172 return { queuedFinal : true , counts : { final : 1 , tool : 0 , block : 0 } } ;
173173 } ) ;
174174
175- const ctx = await createAutomaticSourceDeliveryContext ( {
175+ const ctx = await createAutomaticDraftContext ( {
176176 discordConfig : { streaming : { mode : "partial" } , maxLinesPerMessage : 5 } ,
177177 } ) ;
178178
@@ -188,7 +188,7 @@ describe("processDiscordMessage draft streaming final delivery", () => {
188188 return { queuedFinal : true , counts : { final : 1 , tool : 0 , block : 0 } } ;
189189 } ) ;
190190
191- const ctx = await createAutomaticSourceDeliveryContext ( {
191+ const ctx = await createAutomaticDraftContext ( {
192192 discordConfig : { streaming : { mode : "partial" } , maxLinesPerMessage : 5 } ,
193193 } ) ;
194194
@@ -205,7 +205,7 @@ describe("processDiscordMessage draft streaming final delivery", () => {
205205 return { queuedFinal : true , counts : { final : 1 , tool : 0 , block : 0 } } ;
206206 } ) ;
207207
208- const ctx = await createAutomaticSourceDeliveryContext ( {
208+ const ctx = await createAutomaticDraftContext ( {
209209 discordConfig : { streaming : { mode : "partial" } , maxLinesPerMessage : 5 } ,
210210 } ) ;
211211
@@ -224,7 +224,7 @@ describe("processDiscordMessage draft streaming final delivery", () => {
224224 return { queuedFinal : true , counts : { final : 1 , tool : 0 , block : 0 } } ;
225225 } ) ;
226226
227- const ctx = await createAutomaticSourceDeliveryContext ( {
227+ const ctx = await createAutomaticDraftContext ( {
228228 discordConfig : { streaming : { mode : "partial" } , maxLinesPerMessage : 5 } ,
229229 cfg : {
230230 channels : { discord : { mentionAliases : { Sentinel : "1485891428809707651" } } } ,
@@ -258,7 +258,7 @@ describe("processDiscordMessage draft streaming final delivery", () => {
258258 return { queuedFinal : true , counts : { final : 1 , tool : 0 , block : 0 } } ;
259259 } ) ;
260260
261- const ctx = await createAutomaticSourceDeliveryContext ( {
261+ const ctx = await createAutomaticDraftContext ( {
262262 discordConfig : { streaming : { mode : "progress" } , maxLinesPerMessage : 5 } ,
263263 } ) ;
264264
@@ -301,7 +301,7 @@ describe("processDiscordMessage draft streaming final delivery", () => {
301301 return { queuedFinal : true , counts : { final : 1 , tool : 0 , block : 0 } } ;
302302 } ) ;
303303
304- const ctx = await createAutomaticSourceDeliveryContext ( {
304+ const ctx = await createAutomaticDraftContext ( {
305305 baseSessionKey : BASE_CHANNEL_ROUTE . sessionKey ,
306306 discordConfig : { streaming : { mode : "progress" } , maxLinesPerMessage : 5 } ,
307307 route : BASE_CHANNEL_ROUTE ,
@@ -326,7 +326,7 @@ describe("processDiscordMessage draft streaming final delivery", () => {
326326 return { queuedFinal : true , counts : { final : 1 , tool : 0 , block : 0 } } ;
327327 } ) ;
328328
329- const ctx = await createAutomaticSourceDeliveryContext ( {
329+ const ctx = await createAutomaticDraftContext ( {
330330 discordConfig : {
331331 maxLinesPerMessage : 5 ,
332332 streaming : {
@@ -365,7 +365,7 @@ describe("processDiscordMessage draft streaming final delivery", () => {
365365 return { queuedFinal : true , counts : { final : 1 , tool : 0 , block : 0 } } ;
366366 } ) ;
367367
368- const ctx = await createAutomaticSourceDeliveryContext ( {
368+ const ctx = await createAutomaticDraftContext ( {
369369 discordConfig : { streaming : { mode : "progress" } , maxLinesPerMessage : 5 } ,
370370 } ) ;
371371
@@ -391,7 +391,7 @@ describe("processDiscordMessage draft streaming final delivery", () => {
391391 return { queuedFinal : true , counts : { final : 1 , tool : 0 , block : 0 } } ;
392392 } ) ;
393393
394- const ctx = await createAutomaticSourceDeliveryContext ( {
394+ const ctx = await createAutomaticDraftContext ( {
395395 discordConfig : { streaming : { mode : "progress" } } ,
396396 } ) ;
397397 await runProcessDiscordMessage ( ctx ) ;
@@ -401,7 +401,7 @@ describe("processDiscordMessage draft streaming final delivery", () => {
401401 createMockDraftStreamForTest ( ) ;
402402 dispatchInboundMessage . mockImplementationOnce ( async ( ) => createNoQueuedDispatchResult ( ) ) ;
403403
404- const ctx = await createAutomaticSourceDeliveryContext ( {
404+ const ctx = await createAutomaticDraftContext ( {
405405 discordConfig : {
406406 streaming : { mode : "progress" , progress : { label : "Shelling" , narration : false } } ,
407407 } ,
@@ -417,7 +417,7 @@ describe("processDiscordMessage draft streaming final delivery", () => {
417417 createMockDraftStreamForTest ( ) ;
418418 dispatchInboundMessage . mockImplementationOnce ( async ( ) => createNoQueuedDispatchResult ( ) ) ;
419419
420- const ctx = await createAutomaticSourceDeliveryContext ( {
420+ const ctx = await createAutomaticDraftContext ( {
421421 discordConfig : {
422422 streaming : { mode : "progress" , progress : { label : "Shelling" , commandText : "status" } } ,
423423 } ,
@@ -447,7 +447,7 @@ describe("processDiscordMessage draft streaming final delivery", () => {
447447 return createNoQueuedDispatchResult ( ) ;
448448 } ) ;
449449
450- const ctx = await createAutomaticSourceDeliveryContext ( {
450+ const ctx = await createAutomaticDraftContext ( {
451451 discordConfig : { streaming : { mode : "progress" } , maxLinesPerMessage : 5 } ,
452452 } ) ;
453453
@@ -472,7 +472,7 @@ describe("processDiscordMessage draft streaming final delivery", () => {
472472 return createNoQueuedDispatchResult ( ) ;
473473 } ) ;
474474
475- const ctx = await createAutomaticSourceDeliveryContext ( {
475+ const ctx = await createAutomaticDraftContext ( {
476476 discordConfig : { streaming : { mode : "progress" } , maxLinesPerMessage : 5 } ,
477477 } ) ;
478478
@@ -492,7 +492,7 @@ describe("processDiscordMessage draft streaming final delivery", () => {
492492 return createNoQueuedDispatchResult ( ) ;
493493 } ) ;
494494
495- const ctx = await createAutomaticSourceDeliveryContext ( {
495+ const ctx = await createAutomaticDraftContext ( {
496496 discordConfig : { streaming : { mode : "progress" } } ,
497497 } ) ;
498498
@@ -518,7 +518,7 @@ describe("processDiscordMessage draft streaming final delivery", () => {
518518 return { queuedFinal : true , counts : { final : 1 , tool : 0 , block : 0 } } ;
519519 } ) ;
520520
521- const ctx = await createAutomaticSourceDeliveryContext ( {
521+ const ctx = await createAutomaticDraftContext ( {
522522 discordConfig : {
523523 streaming : { mode : "progress" , progress : { label : "Shelling" , thinking : true } } ,
524524 } ,
@@ -547,7 +547,7 @@ describe("processDiscordMessage draft streaming final delivery", () => {
547547 return { queuedFinal : true , counts : { final : 1 , tool : 0 , block : 0 } } ;
548548 } ) ;
549549
550- const ctx = await createAutomaticSourceDeliveryContext ( {
550+ const ctx = await createAutomaticDraftContext ( {
551551 discordConfig : {
552552 streaming : { mode : "progress" , progress : { label : "Shelling" , thinking : true } } ,
553553 } ,
@@ -585,7 +585,7 @@ describe("processDiscordMessage draft streaming final delivery", () => {
585585 return { queuedFinal : true , counts : { final : 1 , tool : 0 , block : 0 } } ;
586586 } ) ;
587587
588- const ctx = await createAutomaticSourceDeliveryContext ( {
588+ const ctx = await createAutomaticDraftContext ( {
589589 discordConfig : {
590590 streaming : { mode : "progress" , progress : { label : "Shelling" , commentary : true } } ,
591591 } ,
@@ -615,7 +615,7 @@ describe("processDiscordMessage draft streaming final delivery", () => {
615615 return { queuedFinal : true , counts : { final : 1 , tool : 0 , block : 0 } } ;
616616 } ) ;
617617
618- const ctx = await createAutomaticSourceDeliveryContext ( {
618+ const ctx = await createAutomaticDraftContext ( {
619619 discordConfig : {
620620 maxLinesPerMessage : 5 ,
621621 streaming : { mode : "progress" , progress : { label : "Shelling" } } ,
@@ -648,7 +648,7 @@ describe("processDiscordMessage draft streaming final delivery", () => {
648648 return { queuedFinal : true , counts : { final : 1 , tool : 0 , block : 0 } } ;
649649 } ) ;
650650
651- const ctx = await createAutomaticSourceDeliveryContext ( {
651+ const ctx = await createAutomaticDraftContext ( {
652652 discordConfig : {
653653 maxLinesPerMessage : 5 ,
654654 streaming : { mode : "progress" , progress : { label : "Shelling" } } ,
0 commit comments