@@ -635,9 +635,11 @@ describe("AwsBedrockHandler", () => {
635
635
expect ( mockConverseStreamCommand ) . toHaveBeenCalled ( )
636
636
const commandArg = mockConverseStreamCommand . mock . calls [ 0 ] [ 0 ] as any
637
637
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 ( )
641
643
} )
642
644
643
645
it ( "should not include anthropic_beta parameter when 1M context is disabled" , async ( ) => {
@@ -663,8 +665,8 @@ describe("AwsBedrockHandler", () => {
663
665
expect ( mockConverseStreamCommand ) . toHaveBeenCalled ( )
664
666
const commandArg = mockConverseStreamCommand . mock . calls [ 0 ] [ 0 ] as any
665
667
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 ( )
668
670
} )
669
671
670
672
it ( "should not include anthropic_beta parameter for non-Claude Sonnet 4 models" , async ( ) => {
@@ -690,8 +692,8 @@ describe("AwsBedrockHandler", () => {
690
692
expect ( mockConverseStreamCommand ) . toHaveBeenCalled ( )
691
693
const commandArg = mockConverseStreamCommand . mock . calls [ 0 ] [ 0 ] as any
692
694
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 ( )
695
697
} )
696
698
697
699
it ( "should enable 1M context window with cross-region inference for Claude Sonnet 4" , ( ) => {
@@ -738,9 +740,11 @@ describe("AwsBedrockHandler", () => {
738
740
mockConverseStreamCommand . mock . calls . length - 1
739
741
] [ 0 ] as any
740
742
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 ( )
744
748
// Model ID should have cross-region prefix
745
749
expect ( commandArg . modelId ) . toBe ( `us.${ BEDROCK_CLAUDE_SONNET_4_MODEL_ID } ` )
746
750
} )
0 commit comments