@@ -375,12 +375,41 @@ describe("shouldUseReasoningEffort", () => {
375
375
reasoningEffort : "medium" ,
376
376
}
377
377
378
- // Should return true regardless of settings
378
+ // Should return true regardless of settings (unless explicitly disabled)
379
379
expect ( shouldUseReasoningEffort ( { model } ) ) . toBe ( true )
380
380
expect ( shouldUseReasoningEffort ( { model, settings : { } } ) ) . toBe ( true )
381
381
expect ( shouldUseReasoningEffort ( { model, settings : { reasoningEffort : undefined } } ) ) . toBe ( true )
382
382
} )
383
383
384
+ test ( "should return false when enableReasoningEffort is false, even if reasoningEffort is set" , ( ) => {
385
+ const model : ModelInfo = {
386
+ contextWindow : 200_000 ,
387
+ supportsPromptCache : true ,
388
+ supportsReasoningEffort : true ,
389
+ }
390
+
391
+ const settings : ProviderSettings = {
392
+ enableReasoningEffort : false ,
393
+ reasoningEffort : "medium" ,
394
+ }
395
+
396
+ expect ( shouldUseReasoningEffort ( { model, settings } ) ) . toBe ( false )
397
+ } )
398
+
399
+ test ( "should return false when enableReasoningEffort is false, even if model has reasoningEffort property" , ( ) => {
400
+ const model : ModelInfo = {
401
+ contextWindow : 200_000 ,
402
+ supportsPromptCache : true ,
403
+ reasoningEffort : "medium" ,
404
+ }
405
+
406
+ const settings : ProviderSettings = {
407
+ enableReasoningEffort : false ,
408
+ }
409
+
410
+ expect ( shouldUseReasoningEffort ( { model, settings } ) ) . toBe ( false )
411
+ } )
412
+
384
413
test ( "should return true when model supports reasoning effort and settings provide reasoning effort" , ( ) => {
385
414
const model : ModelInfo = {
386
415
contextWindow : 200_000 ,
0 commit comments