@@ -1434,9 +1434,9 @@ describe("same-provider OAuth account fallback", () => {
14341434 assert . deepEqual ( calls , [ "stream-1.test" , "stream-2.test" , "stream-3.test" ] ) ;
14351435 } ) ;
14361436
1437- it ( "bounds pre-output stream inspection and reroutes an oversized metadata preamble" , async ( ) => {
1437+ it ( "passes through an oversized metadata preamble without locking or rerouting " , async ( ) => {
14381438 const store = createStore ( tmpConfig ( ) ) ;
1439- const providers = [ "Slow preamble" , "Backup" ] . map ( ( name , index ) => ( {
1439+ const providers = [ "Large preamble" , "Backup" ] . map ( ( name , index ) => ( {
14401440 id : `prov_bounded_${ index + 1 } ` ,
14411441 type : "openai-compat" ,
14421442 name,
@@ -1474,6 +1474,12 @@ describe("same-provider OAuth account fallback", () => {
14741474 `data: ${ JSON . stringify ( { type : "response.created" , padding : "x" . repeat ( 70 * 1024 ) } ) } \n\n`
14751475 )
14761476 ) ;
1477+ controller . enqueue (
1478+ new TextEncoder ( ) . encode (
1479+ `event: response.output_text.delta\ndata: ${ JSON . stringify ( { type : "response.output_text.delta" , delta : "large preamble success" } ) } \n\n`
1480+ )
1481+ ) ;
1482+ controller . close ( ) ;
14771483 } ,
14781484 cancel ( ) {
14791485 canceled = true ;
@@ -1483,7 +1489,7 @@ describe("same-provider OAuth account fallback", () => {
14831489 ) ;
14841490 }
14851491 return new Response (
1486- `data: ${ JSON . stringify ( { choices : [ { delta : { content : "bounded fallback" } } ] } ) } \n\ndata: [DONE]\n\n` ,
1492+ `data: ${ JSON . stringify ( { choices : [ { delta : { content : "unexpected fallback" } } ] } ) } \n\ndata: [DONE]\n\n` ,
14871493 { status : 200 , headers : { "Content-Type" : "text/event-stream" } }
14881494 ) ;
14891495 } ,
@@ -1500,9 +1506,9 @@ describe("same-provider OAuth account fallback", () => {
15001506 await result . streamPipe ( { write : ( chunk ) => chunks . push ( String ( chunk ) ) } ) ;
15011507
15021508 assert . equal ( result . ok , true , JSON . stringify ( result . error ) ) ;
1503- assert . equal ( canceled , true ) ;
1504- assert . match ( chunks . join ( "" ) , / b o u n d e d f a l l b a c k / ) ;
1505- assert . deepEqual ( calls , [ "bounded-1.test" , "bounded-2.test" ] ) ;
1509+ assert . equal ( canceled , false ) ;
1510+ assert . match ( chunks . join ( "" ) , / l a r g e p r e a m b l e s u c c e s s / ) ;
1511+ assert . deepEqual ( calls , [ "bounded-1.test" ] ) ;
15061512 } ) ;
15071513
15081514 it ( "records streaming usage after the final SSE event instead of an early zero-token success" , async ( ) => {
0 commit comments