@@ -2063,6 +2063,68 @@ describe("dispatchReplyFromConfig", () => {
20632063 expect ( dispatcher . sendFinalReply ) . not . toHaveBeenCalled ( ) ;
20642064 } ) ;
20652065
2066+ it ( "suppresses terminal tool-error fallbacks when regular verbose progress is visible" , async ( ) => {
2067+ setNoAbort ( ) ;
2068+ sessionStoreMocks . currentEntry = {
2069+ sessionId : "s1" ,
2070+ updatedAt : 0 ,
2071+ sendPolicy : "allow" ,
2072+ verboseLevel : "on" ,
2073+ } ;
2074+ const dispatcher = createDispatcher ( ) ;
2075+ const ctx = buildTestCtx ( {
2076+ Provider : "telegram" ,
2077+ ChatType : "direct" ,
2078+ SessionKey : "agent:main:telegram:direct:U1" ,
2079+ } ) ;
2080+ let receivedOptions : GetReplyOptions | undefined ;
2081+ const replyResolver = vi . fn ( async ( _ctx : MsgContext , opts ?: GetReplyOptions ) => {
2082+ receivedOptions = opts ;
2083+ return { text : "done" } satisfies ReplyPayload ;
2084+ } ) ;
2085+
2086+ await dispatchReplyFromConfig ( {
2087+ ctx,
2088+ cfg : emptyConfig ,
2089+ dispatcher,
2090+ replyResolver,
2091+ } ) ;
2092+
2093+ expect ( receivedOptions ?. suppressToolErrorWarnings ) . toBe ( true ) ;
2094+ expect ( dispatcher . sendFinalReply ) . toHaveBeenCalledWith ( { text : "done" } ) ;
2095+ } ) ;
2096+
2097+ it ( "keeps terminal tool-error fallbacks available in verbose full mode" , async ( ) => {
2098+ setNoAbort ( ) ;
2099+ sessionStoreMocks . currentEntry = {
2100+ sessionId : "s1" ,
2101+ updatedAt : 0 ,
2102+ sendPolicy : "allow" ,
2103+ verboseLevel : "full" ,
2104+ } ;
2105+ const dispatcher = createDispatcher ( ) ;
2106+ const ctx = buildTestCtx ( {
2107+ Provider : "telegram" ,
2108+ ChatType : "direct" ,
2109+ SessionKey : "agent:main:telegram:direct:U1" ,
2110+ } ) ;
2111+ let receivedOptions : GetReplyOptions | undefined ;
2112+ const replyResolver = vi . fn ( async ( _ctx : MsgContext , opts ?: GetReplyOptions ) => {
2113+ receivedOptions = opts ;
2114+ return { text : "done" } satisfies ReplyPayload ;
2115+ } ) ;
2116+
2117+ await dispatchReplyFromConfig ( {
2118+ ctx,
2119+ cfg : emptyConfig ,
2120+ dispatcher,
2121+ replyResolver,
2122+ } ) ;
2123+
2124+ expect ( receivedOptions ?. suppressToolErrorWarnings ) . toBeUndefined ( ) ;
2125+ expect ( dispatcher . sendFinalReply ) . toHaveBeenCalledWith ( { text : "done" } ) ;
2126+ } ) ;
2127+
20662128 it ( "delivers text-only tool summaries when verbose overrides preview suppression" , async ( ) => {
20672129 setNoAbort ( ) ;
20682130 sessionStoreMocks . currentEntry = {
0 commit comments