@@ -640,7 +640,6 @@ describe("dispatchTelegramMessage draft streaming", () => {
640640 chatId : 123 ,
641641 thread : { id : 777 , scope : "dm" } ,
642642 minInitialChars : 30 ,
643- minInitialDelayMs : 5000 ,
644643 } ) ;
645644 expect ( draftStream . update ) . toHaveBeenCalledWith ( "Hello" ) ;
646645 const delivery = expectDeliverRepliesParams ( { thread : { id : 777 , scope : "dm" } } ) ;
@@ -2640,27 +2639,6 @@ describe("dispatchTelegramMessage draft streaming", () => {
26402639 expect ( editMessageTelegram ) . not . toHaveBeenCalled ( ) ;
26412640 } ) ;
26422641
2643- it ( "shows a stable progress placeholder for progress-mode answer activity" , async ( ) => {
2644- const { answerDraftStream } = setupDraftStreams ( { answerMessageId : 2001 } ) ;
2645- dispatchReplyWithBufferedBlockDispatcher . mockImplementation ( async ( { replyOptions } ) => {
2646- await replyOptions ?. onPartialReply ?.( { text : "Short" } ) ;
2647- await replyOptions ?. onPartialReply ?.( { text : "Short answer" } ) ;
2648- return { queuedFinal : false } ;
2649- } ) ;
2650-
2651- await dispatchWithContext ( {
2652- context : createContext ( ) ,
2653- streamMode : "progress" ,
2654- telegramCfg : { streaming : { mode : "progress" , progress : { label : "Shelling" } } } ,
2655- } ) ;
2656-
2657- expect ( answerDraftStream . update ) . not . toHaveBeenCalledWith ( "Short" ) ;
2658- expect ( answerDraftStream . update ) . not . toHaveBeenCalledWith ( "Short answer" ) ;
2659- expect ( answerDraftStream . updatePreview ) . toHaveBeenCalledWith (
2660- telegramProgressPreview ( "Shelling" , "<b>Shelling</b>" ) ,
2661- ) ;
2662- } ) ;
2663-
26642642 it ( "replaces Telegram command progress items with matching command output" , async ( ) => {
26652643 const { answerDraftStream } = setupDraftStreams ( { answerMessageId : 2001 } ) ;
26662644 dispatchReplyWithBufferedBlockDispatcher . mockImplementation ( async ( { replyOptions } ) => {
@@ -2727,67 +2705,6 @@ describe("dispatchTelegramMessage draft streaming", () => {
27272705 expectDeliveredReply ( 0 , { text : "Branch is up to date" } ) ;
27282706 } ) ;
27292707
2730- it ( "clears progress drafts before durable verbose tool output" , async ( ) => {
2731- const { answerDraftStream } = setupDraftStreams ( { answerMessageId : 2001 } ) ;
2732- dispatchReplyWithBufferedBlockDispatcher . mockImplementation (
2733- async ( { dispatcherOptions, replyOptions } ) => {
2734- await replyOptions ?. onToolStart ?.( { name : "exec" , phase : "start" } ) ;
2735- replyOptions ?. onVerboseProgressVisibility ?.( ( ) => true ) ;
2736- await dispatcherOptions . deliver (
2737- { text : "Tool output visible to Telegram" } ,
2738- { kind : "tool" } ,
2739- ) ;
2740- await dispatcherOptions . deliver ( { text : "Final answer" } , { kind : "final" } ) ;
2741- return { queuedFinal : true } ;
2742- } ,
2743- ) ;
2744-
2745- await dispatchWithContext ( {
2746- context : createContext ( ) ,
2747- streamMode : "progress" ,
2748- telegramCfg : { streaming : { mode : "progress" , progress : { label : "Shelling" } } } ,
2749- } ) ;
2750-
2751- expect ( answerDraftStream . updatePreview ) . toHaveBeenCalledWith (
2752- telegramProgressPreview ( "Shelling\n\n🛠️ Exec" , "<b>Shelling</b>\n<b>🛠️ Exec</b>" ) ,
2753- ) ;
2754- expectDeliveredReply ( 0 , { text : "Tool output visible to Telegram" } ) ;
2755- expectDeliveredReply ( 0 , { text : "Final answer" } , 1 ) ;
2756- expect ( answerDraftStream . clear . mock . invocationCallOrder [ 0 ] ) . toBeLessThan (
2757- deliverReplies . mock . invocationCallOrder [ 0 ] ,
2758- ) ;
2759- } ) ;
2760-
2761- it ( "clears progress drafts before visible tool artifacts" , async ( ) => {
2762- const { answerDraftStream } = setupDraftStreams ( { answerMessageId : 2001 } ) ;
2763- dispatchReplyWithBufferedBlockDispatcher . mockImplementation (
2764- async ( { dispatcherOptions, replyOptions } ) => {
2765- await replyOptions ?. onToolStart ?.( { name : "exec" , phase : "start" } ) ;
2766- await dispatcherOptions . deliver (
2767- { mediaUrl : "https://example.com/validation.txt" } ,
2768- { kind : "tool" } ,
2769- ) ;
2770- await dispatcherOptions . deliver ( { text : "Final answer" } , { kind : "final" } ) ;
2771- return { queuedFinal : true } ;
2772- } ,
2773- ) ;
2774-
2775- await dispatchWithContext ( {
2776- context : createContext ( ) ,
2777- streamMode : "progress" ,
2778- telegramCfg : { streaming : { mode : "progress" , progress : { label : "Shelling" } } } ,
2779- } ) ;
2780-
2781- expect ( answerDraftStream . updatePreview ) . toHaveBeenCalledWith (
2782- telegramProgressPreview ( "Shelling\n\n🛠️ Exec" , "<b>Shelling</b>\n<b>🛠️ Exec</b>" ) ,
2783- ) ;
2784- expectDeliveredReply ( 0 , { mediaUrl : "https://example.com/validation.txt" } ) ;
2785- expectDeliveredReply ( 0 , { text : "Final answer" } , 1 ) ;
2786- expect ( answerDraftStream . clear . mock . invocationCallOrder [ 0 ] ) . toBeLessThan (
2787- deliverReplies . mock . invocationCallOrder [ 0 ] ,
2788- ) ;
2789- } ) ;
2790-
27912708 it ( "does not stream text-only tool results into progress drafts" , async ( ) => {
27922709 const { answerDraftStream } = setupDraftStreams ( { answerMessageId : 2001 } ) ;
27932710 dispatchReplyWithBufferedBlockDispatcher . mockImplementation (
@@ -2819,7 +2736,7 @@ describe("dispatchTelegramMessage draft streaming", () => {
28192736 expect ( deliverReplies ) . not . toHaveBeenCalled ( ) ;
28202737 } ) ;
28212738
2822- it ( "renders api progress item edge cases as plain transport previews" , async ( ) => {
2739+ it ( "renders api progress item edge cases as HTML transport previews" , async ( ) => {
28232740 const { answerDraftStream } = setupDraftStreams ( { answerMessageId : 2001 } ) ;
28242741 dispatchReplyWithBufferedBlockDispatcher . mockImplementation ( async ( { replyOptions } ) => {
28252742 await replyOptions ?. onItemEvent ?.( { kind : "api" , progressText : "GET /v1/users" } ) ;
0 commit comments