@@ -635,9 +635,11 @@ describe("AwsBedrockHandler", () => {
635635 expect ( mockConverseStreamCommand ) . toHaveBeenCalled ( )
636636 const commandArg = mockConverseStreamCommand . mock . calls [ 0 ] [ 0 ] as any
637637
638- // Should include anthropic_beta parameter but NOT anthropic_version (only for thinking)
639- expect ( commandArg . anthropic_beta ) . toEqual ( [ "context-1m-2025-08-07" ] )
640- expect ( commandArg . anthropic_version ) . toBeUndefined ( )
638+ // Should include anthropic_beta in additionalModelRequestFields
639+ expect ( commandArg . additionalModelRequestFields ) . toBeDefined ( )
640+ expect ( commandArg . additionalModelRequestFields . anthropic_beta ) . toEqual ( [ "context-1m-2025-08-07" ] )
641+ // Should not include anthropic_version since thinking is not enabled
642+ expect ( commandArg . additionalModelRequestFields . anthropic_version ) . toBeUndefined ( )
641643 } )
642644
643645 it ( "should not include anthropic_beta parameter when 1M context is disabled" , async ( ) => {
@@ -663,8 +665,8 @@ describe("AwsBedrockHandler", () => {
663665 expect ( mockConverseStreamCommand ) . toHaveBeenCalled ( )
664666 const commandArg = mockConverseStreamCommand . mock . calls [ 0 ] [ 0 ] as any
665667
666- // Should not include anthropic_beta parameter
667- expect ( commandArg . anthropic_beta ) . toBeUndefined ( )
668+ // Should not include anthropic_beta in additionalModelRequestFields
669+ expect ( commandArg . additionalModelRequestFields ) . toBeUndefined ( )
668670 } )
669671
670672 it ( "should not include anthropic_beta parameter for non-Claude Sonnet 4 models" , async ( ) => {
@@ -690,8 +692,8 @@ describe("AwsBedrockHandler", () => {
690692 expect ( mockConverseStreamCommand ) . toHaveBeenCalled ( )
691693 const commandArg = mockConverseStreamCommand . mock . calls [ 0 ] [ 0 ] as any
692694
693- // Should not include anthropic_beta parameter for non-Sonnet 4 models
694- expect ( commandArg . anthropic_beta ) . toBeUndefined ( )
695+ // Should not include anthropic_beta for non-Sonnet 4 models
696+ expect ( commandArg . additionalModelRequestFields ) . toBeUndefined ( )
695697 } )
696698
697699 it ( "should enable 1M context window with cross-region inference for Claude Sonnet 4" , ( ) => {
@@ -738,9 +740,11 @@ describe("AwsBedrockHandler", () => {
738740 mockConverseStreamCommand . mock . calls . length - 1
739741 ] [ 0 ] as any
740742
741- // Should include anthropic_beta parameter but NOT anthropic_version (only for thinking)
742- expect ( commandArg . anthropic_beta ) . toEqual ( [ "context-1m-2025-08-07" ] )
743- expect ( commandArg . anthropic_version ) . toBeUndefined ( )
743+ // Should include anthropic_beta in additionalModelRequestFields
744+ expect ( commandArg . additionalModelRequestFields ) . toBeDefined ( )
745+ expect ( commandArg . additionalModelRequestFields . anthropic_beta ) . toEqual ( [ "context-1m-2025-08-07" ] )
746+ // Should not include anthropic_version since thinking is not enabled
747+ expect ( commandArg . additionalModelRequestFields . anthropic_version ) . toBeUndefined ( )
744748 // Model ID should have cross-region prefix
745749 expect ( commandArg . modelId ) . toBe ( `us.${ BEDROCK_CLAUDE_SONNET_4_MODEL_ID } ` )
746750 } )
0 commit comments