@@ -770,11 +770,16 @@ describe('BedrockModel', () => {
770770
771771 collectEvents ( provider . stream ( messages , options ) )
772772
773- expect ( mockConverseStreamCommand ) . toHaveBeenLastCalledWith (
774- expect . objectContaining ( {
775- system : [ { text : 'You are a helpful assistant' } ] ,
776- } )
777- )
773+ expect ( mockConverseStreamCommand ) . toHaveBeenLastCalledWith ( {
774+ modelId : 'global.anthropic.claude-sonnet-4-5-20250929-v1:0' ,
775+ messages : [
776+ {
777+ role : 'user' ,
778+ content : [ { text : 'Hello' } ] ,
779+ } ,
780+ ] ,
781+ system : [ { text : 'You are a helpful assistant' } ] ,
782+ } )
778783 } )
779784
780785 it ( 'formats string system prompt with cachePrompt config' , async ( ) => {
@@ -786,11 +791,16 @@ describe('BedrockModel', () => {
786791
787792 collectEvents ( provider . stream ( messages , options ) )
788793
789- expect ( mockConverseStreamCommand ) . toHaveBeenLastCalledWith (
790- expect . objectContaining ( {
791- system : [ { text : 'You are a helpful assistant' } , { cachePoint : { type : 'default' } } ] ,
792- } )
793- )
794+ expect ( mockConverseStreamCommand ) . toHaveBeenLastCalledWith ( {
795+ modelId : 'global.anthropic.claude-sonnet-4-5-20250929-v1:0' ,
796+ messages : [
797+ {
798+ role : 'user' ,
799+ content : [ { text : 'Hello' } ] ,
800+ } ,
801+ ] ,
802+ system : [ { text : 'You are a helpful assistant' } , { cachePoint : { type : 'default' } } ] ,
803+ } )
794804 } )
795805
796806 it ( 'formats array system prompt with text blocks only' , async ( ) => {
@@ -805,11 +815,16 @@ describe('BedrockModel', () => {
805815
806816 collectEvents ( provider . stream ( messages , options ) )
807817
808- expect ( mockConverseStreamCommand ) . toHaveBeenLastCalledWith (
809- expect . objectContaining ( {
810- system : [ { text : 'You are a helpful assistant' } , { text : 'Additional context here' } ] ,
811- } )
812- )
818+ expect ( mockConverseStreamCommand ) . toHaveBeenLastCalledWith ( {
819+ modelId : 'global.anthropic.claude-sonnet-4-5-20250929-v1:0' ,
820+ messages : [
821+ {
822+ role : 'user' ,
823+ content : [ { text : 'Hello' } ] ,
824+ } ,
825+ ] ,
826+ system : [ { text : 'You are a helpful assistant' } , { text : 'Additional context here' } ] ,
827+ } )
813828 } )
814829
815830 it ( 'formats array system prompt with cache points' , async ( ) => {
@@ -825,15 +840,20 @@ describe('BedrockModel', () => {
825840
826841 collectEvents ( provider . stream ( messages , options ) )
827842
828- expect ( mockConverseStreamCommand ) . toHaveBeenLastCalledWith (
829- expect . objectContaining ( {
830- system : [
831- { text : 'You are a helpful assistant' } ,
832- { text : 'Large context document' } ,
833- { cachePoint : { type : 'default' } } ,
834- ] ,
835- } )
836- )
843+ expect ( mockConverseStreamCommand ) . toHaveBeenLastCalledWith ( {
844+ modelId : 'global.anthropic.claude-sonnet-4-5-20250929-v1:0' ,
845+ messages : [
846+ {
847+ role : 'user' ,
848+ content : [ { text : 'Hello' } ] ,
849+ } ,
850+ ] ,
851+ system : [
852+ { text : 'You are a helpful assistant' } ,
853+ { text : 'Large context document' } ,
854+ { cachePoint : { type : 'default' } } ,
855+ ] ,
856+ } )
837857 } )
838858
839859 it ( 'warns when both array system prompt and cachePrompt config are provided' , async ( ) => {
@@ -855,11 +875,16 @@ describe('BedrockModel', () => {
855875 )
856876
857877 // Verify array is used as-is (cachePrompt config ignored)
858- expect ( mockConverseStreamCommand ) . toHaveBeenLastCalledWith (
859- expect . objectContaining ( {
860- system : [ { text : 'You are a helpful assistant' } , { cachePoint : { type : 'default' } } ] ,
861- } )
862- )
878+ expect ( mockConverseStreamCommand ) . toHaveBeenLastCalledWith ( {
879+ modelId : 'global.anthropic.claude-sonnet-4-5-20250929-v1:0' ,
880+ messages : [
881+ {
882+ role : 'user' ,
883+ content : [ { text : 'Hello' } ] ,
884+ } ,
885+ ] ,
886+ system : [ { text : 'You are a helpful assistant' } , { cachePoint : { type : 'default' } } ] ,
887+ } )
863888
864889 warnSpy . mockRestore ( )
865890 } )
@@ -874,11 +899,15 @@ describe('BedrockModel', () => {
874899 collectEvents ( provider . stream ( messages , options ) )
875900
876901 // Empty array should not set system field
877- expect ( mockConverseStreamCommand ) . toHaveBeenLastCalledWith (
878- expect . not . objectContaining ( {
879- system : expect . anything ( ) ,
880- } )
881- )
902+ expect ( mockConverseStreamCommand ) . toHaveBeenLastCalledWith ( {
903+ modelId : 'global.anthropic.claude-sonnet-4-5-20250929-v1:0' ,
904+ messages : [
905+ {
906+ role : 'user' ,
907+ content : [ { text : 'Hello' } ] ,
908+ } ,
909+ ] ,
910+ } )
882911 } )
883912 } )
884913} )
0 commit comments