@@ -1013,7 +1013,17 @@ describe("AnthropicHandler", () => {
10131013 // Explicitly disable tool use while preserving the available tool definitions.
10141014 expect ( mockCreate ) . toHaveBeenCalledWith (
10151015 expect . objectContaining ( {
1016- tools : expect . any ( Array ) ,
1016+ tools : [
1017+ {
1018+ name : "get_weather" ,
1019+ description : "Get the current weather" ,
1020+ input_schema : {
1021+ type : "object" ,
1022+ properties : { location : { type : "string" } } ,
1023+ required : [ "location" ] ,
1024+ } ,
1025+ } ,
1026+ ] ,
10171027 tool_choice : { type : "none" } ,
10181028 } ) ,
10191029 expect . anything ( ) ,
@@ -1104,6 +1114,27 @@ describe("AnthropicHandler", () => {
11041114 )
11051115 } )
11061116
1117+ it ( "should disable parallel tool calls when tool_choice is omitted for Claude Fable 5.1" , async ( ) => {
1118+ const fableHandler = new AnthropicHandler ( {
1119+ apiKey : "test-api-key" ,
1120+ apiModelId : "claude-fable-5-1" ,
1121+ } )
1122+ const stream = fableHandler . createMessage ( systemPrompt , messages , {
1123+ taskId : "test-task" ,
1124+ tools : mockTools ,
1125+ parallelToolCalls : false ,
1126+ } )
1127+
1128+ await collectStream ( stream )
1129+
1130+ expect ( mockCreate ) . toHaveBeenCalledWith (
1131+ expect . objectContaining ( {
1132+ tool_choice : { type : "auto" , disable_parallel_tool_use : true } ,
1133+ } ) ,
1134+ expect . anything ( ) ,
1135+ )
1136+ } )
1137+
11071138 it ( "should preserve an explicit none tool_choice for Claude Fable 5.1" , async ( ) => {
11081139 const fableHandler = new AnthropicHandler ( {
11091140 apiKey : "test-api-key" ,
0 commit comments