@@ -3103,13 +3103,20 @@ describe("ProviderTransform.reasoningVariants", () => {
31033103 ) . toEqual ( { high : { effort : "high" } } )
31043104 } )
31053105
3106- test ( "leaves legacy Anthropic effort options to budget fallback " , ( ) => {
3106+ test ( "uses explicit effort metadata for Anthropic-compatible models " , ( ) => {
31073107 expect (
31083108 ProviderTransform . reasoningVariants (
31093109 model ( [ { type : "effort" , values : [ "high" ] } ] ) ,
31103110 target ( "@ai-sdk/anthropic" , "claude-sonnet-4" ) ,
31113111 ) ,
3112- ) . toBeUndefined ( )
3112+ ) . toEqual ( { high : { effort : "high" } } )
3113+
3114+ expect (
3115+ ProviderTransform . reasoningVariants (
3116+ model ( [ { type : "effort" , values : [ "max" ] } ] ) ,
3117+ target ( "@ai-sdk/anthropic" , "k3" ) ,
3118+ ) ,
3119+ ) . toEqual ( { max : { effort : "max" } } )
31133120 } )
31143121
31153122 test ( "uses adaptive reasoning config for Anthropic models on Bedrock" , ( ) => {
@@ -3129,13 +3136,13 @@ describe("ProviderTransform.reasoningVariants", () => {
31293136 } )
31303137 } )
31313138
3132- test ( "leaves legacy Anthropic Bedrock effort options to budget fallback " , ( ) => {
3139+ test ( "does not replace unsupported Anthropic Bedrock effort options with token budgets " , ( ) => {
31333140 expect (
31343141 ProviderTransform . reasoningVariants (
31353142 model ( [ { type : "effort" , values : [ "high" ] } ] ) ,
31363143 target ( "@ai-sdk/amazon-bedrock" , "anthropic.claude-sonnet-4-v1:0" ) ,
31373144 ) ,
3138- ) . toBeUndefined ( )
3145+ ) . toEqual ( { } )
31393146 } )
31403147
31413148 test . each ( [
@@ -3256,10 +3263,13 @@ describe("ProviderTransform.reasoningVariants", () => {
32563263 } )
32573264 } )
32583265
3259- test ( "leaves unsupported options for heuristic fallback " , ( ) => {
3266+ test ( "does not replace unsupported effort options with heuristic variants " , ( ) => {
32603267 expect (
32613268 ProviderTransform . reasoningVariants ( model ( [ { type : "effort" , values : [ "high" ] } ] ) , target ( "@ai-sdk/perplexity" ) ) ,
3262- ) . toBeUndefined ( )
3269+ ) . toEqual ( { } )
3270+ } )
3271+
3272+ test ( "leaves unsupported toggle options for heuristic fallback" , ( ) => {
32633273 expect ( ProviderTransform . reasoningVariants ( model ( [ { type : "toggle" } ] ) , target ( "@ai-sdk/openai" ) ) ) . toBeUndefined ( )
32643274 } )
32653275
@@ -3275,15 +3285,15 @@ describe("ProviderTransform.reasoningVariants", () => {
32753285 } )
32763286 expect (
32773287 ProviderTransform . reasoningVariants ( effort , target ( "@ai-sdk/github-copilot" , "gemini-3-pro" ) ) ,
3278- ) . toBeUndefined ( )
3288+ ) . toEqual ( { } )
32793289 } )
32803290
32813291 test . each ( [ "@ai-sdk/cohere" , "@ai-sdk/perplexity" , "@ai-sdk/vercel" , "@ai-sdk/alibaba" , "gitlab-ai-provider" ] ) (
32823292 "does not invent effort controls for %s" ,
32833293 ( npm ) => {
32843294 expect (
32853295 ProviderTransform . reasoningVariants ( model ( [ { type : "effort" , values : [ "high" ] } ] ) , target ( npm ) ) ,
3286- ) . toBeUndefined ( )
3296+ ) . toEqual ( { } )
32873297 } ,
32883298 )
32893299} )
0 commit comments