@@ -635,11 +635,10 @@ describe("AwsBedrockHandler", () => {
635635 expect ( mockConverseStreamCommand ) . toHaveBeenCalled ( )
636636 const commandArg = mockConverseStreamCommand . mock . calls [ 0 ] [ 0 ] as any
637637
638- // Should include anthropic_beta in additionalModelRequestFields
639- expect ( commandArg . additionalModelRequestFields ) . toBeDefined ( )
640- expect ( commandArg . additionalModelRequestFields . anthropic_beta ) . toEqual ( [ "context-1m-2025-08-07" ] )
638+ // Should include anthropic_beta at top level of payload
639+ expect ( commandArg . anthropic_beta ) . toEqual ( [ "context-1m-2025-08-07" ] )
641640 // Should not include anthropic_version since thinking is not enabled
642- expect ( commandArg . additionalModelRequestFields . anthropic_version ) . toBeUndefined ( )
641+ expect ( commandArg . anthropic_version ) . toBeUndefined ( )
643642 } )
644643
645644 it ( "should not include anthropic_beta parameter when 1M context is disabled" , async ( ) => {
@@ -665,7 +664,9 @@ describe("AwsBedrockHandler", () => {
665664 expect ( mockConverseStreamCommand ) . toHaveBeenCalled ( )
666665 const commandArg = mockConverseStreamCommand . mock . calls [ 0 ] [ 0 ] as any
667666
668- // Should not include anthropic_beta in additionalModelRequestFields
667+ // Should not include anthropic_beta at top level
668+ expect ( commandArg . anthropic_beta ) . toBeUndefined ( )
669+ // Should not include additionalModelRequestFields when no thinking is enabled
669670 expect ( commandArg . additionalModelRequestFields ) . toBeUndefined ( )
670671 } )
671672
@@ -693,6 +694,7 @@ describe("AwsBedrockHandler", () => {
693694 const commandArg = mockConverseStreamCommand . mock . calls [ 0 ] [ 0 ] as any
694695
695696 // Should not include anthropic_beta for non-Sonnet 4 models
697+ expect ( commandArg . anthropic_beta ) . toBeUndefined ( )
696698 expect ( commandArg . additionalModelRequestFields ) . toBeUndefined ( )
697699 } )
698700
@@ -740,11 +742,10 @@ describe("AwsBedrockHandler", () => {
740742 mockConverseStreamCommand . mock . calls . length - 1
741743 ] [ 0 ] as any
742744
743- // Should include anthropic_beta in additionalModelRequestFields
744- expect ( commandArg . additionalModelRequestFields ) . toBeDefined ( )
745- expect ( commandArg . additionalModelRequestFields . anthropic_beta ) . toEqual ( [ "context-1m-2025-08-07" ] )
745+ // Should include anthropic_beta at top level of payload
746+ expect ( commandArg . anthropic_beta ) . toEqual ( [ "context-1m-2025-08-07" ] )
746747 // Should not include anthropic_version since thinking is not enabled
747- expect ( commandArg . additionalModelRequestFields . anthropic_version ) . toBeUndefined ( )
748+ expect ( commandArg . anthropic_version ) . toBeUndefined ( )
748749 // Model ID should have cross-region prefix
749750 expect ( commandArg . modelId ) . toBe ( `us.${ BEDROCK_CLAUDE_SONNET_4_MODEL_ID } ` )
750751 } )
0 commit comments