@@ -2776,6 +2776,44 @@ describe("dispatchTelegramMessage draft streaming", () => {
27762776 expect ( sendMessageTelegram ) . not . toHaveBeenCalled ( ) ;
27772777 } ) ;
27782778
2779+ it ( "does not add empty-response fallback after message-tool-only delivery skips final text" , async ( ) => {
2780+ setupDraftStreams ( { answerMessageId : 2001 , reasoningMessageId : 3001 } ) ;
2781+ dispatchReplyWithBufferedBlockDispatcher . mockImplementation ( async ( { dispatcherOptions } ) => {
2782+ dispatcherOptions . onSkip ?.( { text : "NO_REPLY" } , { kind : "final" , reason : "silent" } ) ;
2783+ dispatcherOptions . onSkip ?.(
2784+ { text : "automatic final suppressed" } ,
2785+ { kind : "final" , reason : "cancelled" } ,
2786+ ) ;
2787+ return {
2788+ queuedFinal : false ,
2789+ counts : { block : 0 , final : 0 , tool : 0 } ,
2790+ sourceReplyDeliveryMode : "message_tool_only" ,
2791+ } ;
2792+ } ) ;
2793+
2794+ await dispatchWithContext ( {
2795+ context : createContext ( {
2796+ ctxPayload : {
2797+ SessionKey : "agent:main:telegram:group:-100123" ,
2798+ ChatType : "group" ,
2799+ } as unknown as TelegramMessageContext [ "ctxPayload" ] ,
2800+ primaryCtx : {
2801+ message : { chat : { id : - 100123 , type : "supergroup" } } ,
2802+ } as TelegramMessageContext [ "primaryCtx" ] ,
2803+ msg : {
2804+ chat : { id : - 100123 , type : "supergroup" } ,
2805+ message_id : 456 ,
2806+ } as TelegramMessageContext [ "msg" ] ,
2807+ chatId : - 100123 ,
2808+ isGroup : true ,
2809+ } ) ,
2810+ } ) ;
2811+
2812+ expect ( deliverReplies ) . not . toHaveBeenCalled ( ) ;
2813+ expect ( editMessageTelegram ) . not . toHaveBeenCalled ( ) ;
2814+ expect ( sendMessageTelegram ) . not . toHaveBeenCalled ( ) ;
2815+ } ) ;
2816+
27792817 it ( "runs ambient room events as tool-only invisible turns" , async ( ) => {
27802818 const historyKey = "telegram:group:-100123" ;
27812819 const groupHistories = new Map ( [
0 commit comments