@@ -1865,6 +1865,38 @@ describe("runAgentTurnWithFallback", () => {
18651865 } ) ;
18661866 } ) ;
18671867
1868+ it ( "forwards silent-empty reply allowance to CLI backends for message-tool-only turns" , async ( ) => {
1869+ state . isCliProviderMock . mockReturnValue ( true ) ;
1870+ state . runWithModelFallbackMock . mockImplementationOnce ( async ( params : FallbackRunnerParams ) => ( {
1871+ result : await params . run ( "claude-cli" , "sonnet-4.6" ) ,
1872+ provider : "claude-cli" ,
1873+ model : "sonnet-4.6" ,
1874+ attempts : [ ] ,
1875+ } ) ) ;
1876+ state . runCliAgentMock . mockResolvedValueOnce ( {
1877+ payloads : [ ] ,
1878+ meta : { } ,
1879+ } ) ;
1880+
1881+ const runAgentTurnWithFallback = await getRunAgentTurnWithFallback ( ) ;
1882+ const followupRun = createFollowupRun ( ) ;
1883+ followupRun . run . provider = "claude-cli" ;
1884+ followupRun . run . model = "sonnet-4.6" ;
1885+ followupRun . run . sourceReplyDeliveryMode = "message_tool_only" ;
1886+ followupRun . run . allowEmptyAssistantReplyAsSilent = true ;
1887+ followupRun . originatingChannel = "telegram" ;
1888+
1889+ const result = await runAgentTurnWithFallback ( createMinimalRunAgentTurnParams ( { followupRun } ) ) ;
1890+
1891+ expect ( result . kind ) . toBe ( "success" ) ;
1892+ expectMockCallArgFields ( state . runCliAgentMock , 0 , "CLI run params" , {
1893+ sourceReplyDeliveryMode : "message_tool_only" ,
1894+ allowEmptyAssistantReplyAsSilent : true ,
1895+ messageChannel : "telegram" ,
1896+ messageProvider : "telegram" ,
1897+ } ) ;
1898+ } ) ;
1899+
18681900 it ( "passes prepared CLI user turns to the runtime persistence boundary" , async ( ) => {
18691901 state . isCliProviderMock . mockReturnValue ( true ) ;
18701902 state . runWithModelFallbackMock . mockImplementationOnce ( async ( params : FallbackRunnerParams ) => ( {
0 commit comments