@@ -102,6 +102,24 @@ vitest.mock("../../providers/fetchers/modelCache", () => ({
102102 inputPrice : 0 ,
103103 outputPrice : 0 ,
104104 } ,
105+ "minimax/minimax-m2" : {
106+ maxTokens : 32_768 ,
107+ contextWindow : 1_000_000 ,
108+ supportsImages : false ,
109+ supportsPromptCache : true ,
110+ supportsNativeTools : true ,
111+ inputPrice : 0.15 ,
112+ outputPrice : 0.6 ,
113+ } ,
114+ "anthropic/claude-haiku-4.5" : {
115+ maxTokens : 8_192 ,
116+ contextWindow : 200_000 ,
117+ supportsImages : true ,
118+ supportsPromptCache : true ,
119+ supportsNativeTools : true ,
120+ inputPrice : 0.8 ,
121+ outputPrice : 4 ,
122+ } ,
105123 }
106124 }
107125 return { }
@@ -402,6 +420,41 @@ describe("RooHandler", () => {
402420 expect ( modelInfo . info . contextWindow ) . toBeDefined ( )
403421 }
404422 } )
423+
424+ it ( "should apply defaultToolProtocol: native for minimax/minimax-m2" , ( ) => {
425+ const handlerWithMinimax = new RooHandler ( {
426+ apiModelId : "minimax/minimax-m2" ,
427+ } )
428+ const modelInfo = handlerWithMinimax . getModel ( )
429+ expect ( modelInfo . id ) . toBe ( "minimax/minimax-m2" )
430+ expect ( ( modelInfo . info as any ) . defaultToolProtocol ) . toBe ( "native" )
431+ // Verify cached model info is preserved
432+ expect ( modelInfo . info . maxTokens ) . toBe ( 32_768 )
433+ expect ( modelInfo . info . contextWindow ) . toBe ( 1_000_000 )
434+ } )
435+
436+ it ( "should apply defaultToolProtocol: native for anthropic/claude-haiku-4.5" , ( ) => {
437+ const handlerWithHaiku = new RooHandler ( {
438+ apiModelId : "anthropic/claude-haiku-4.5" ,
439+ } )
440+ const modelInfo = handlerWithHaiku . getModel ( )
441+ expect ( modelInfo . id ) . toBe ( "anthropic/claude-haiku-4.5" )
442+ expect ( ( modelInfo . info as any ) . defaultToolProtocol ) . toBe ( "native" )
443+ // Verify cached model info is preserved
444+ expect ( modelInfo . info . maxTokens ) . toBe ( 8_192 )
445+ expect ( modelInfo . info . contextWindow ) . toBe ( 200_000 )
446+ } )
447+
448+ it ( "should not override existing properties when applying MODEL_DEFAULTS" , ( ) => {
449+ const handlerWithMinimax = new RooHandler ( {
450+ apiModelId : "minimax/minimax-m2" ,
451+ } )
452+ const modelInfo = handlerWithMinimax . getModel ( )
453+ // The defaults should be merged, but not overwrite existing cached values
454+ expect ( modelInfo . info . supportsNativeTools ) . toBe ( true )
455+ expect ( modelInfo . info . inputPrice ) . toBe ( 0.15 )
456+ expect ( modelInfo . info . outputPrice ) . toBe ( 0.6 )
457+ } )
405458 } )
406459
407460 describe ( "temperature and model configuration" , ( ) => {
0 commit comments