@@ -61,6 +61,7 @@ type MockModelBehavior = {
6161type MockModelRequest = {
6262 method : string ;
6363 path : string ;
64+ authorization ?: string ;
6465 body : Record < string , unknown > ;
6566} ;
6667
@@ -348,7 +349,12 @@ async function startRoutedMockModelServer(
348349 const body = await readJsonRequest ( req ) ;
349350 if ( url . pathname === "/v1/responses" || url . pathname === "/responses" ) {
350351 const modelId = typeof body . model === "string" ? body . model : "" ;
351- const request = { method : req . method , path : url . pathname , body } ;
352+ const request = {
353+ method : req . method ,
354+ path : url . pathname ,
355+ authorization : req . headers . authorization ,
356+ body,
357+ } ;
352358 const behavior = behaviors [ modelId ] ;
353359 if ( ! behavior ) {
354360 rejectedRequests . push ( request ) ;
@@ -1471,7 +1477,7 @@ describe("TUI PTY real backends", () => {
14711477 "authenticates a manifest-discovered provider and resumes the unchanged local model" ,
14721478 async ( { onTestFinished } ) => {
14731479 const pluginId = "t05-local-auth-fixture" ;
1474- const providerId = "t05-local-auth-provider " ;
1480+ const providerId = "tui-pty-mock " ;
14751481 const profileId = `${ providerId } :default` ;
14761482 const sentinel = `t05-${ randomUUID ( ) } ` ;
14771483 const expectedDigest = createHash ( "sha256" ) . update ( sentinel ) . digest ( "hex" ) ;
@@ -1616,6 +1622,7 @@ export default {
16161622 onTimeout : ( ) => new Error ( "post-auth prompt did not reach the mock provider" ) ,
16171623 } ) ;
16181624 expect ( fixture . mockModel . requests ( ) [ 0 ] ?. body . model ) . toBe ( "gpt-5.5" ) ;
1625+ expect ( fixture . mockModel . requests ( ) [ 0 ] ?. authorization ) . toBe ( `Bearer ${ sentinel } ` ) ;
16191626 await fixture . run . waitForOutput ( "LOCAL_AUTH_RESPONSE" , LOCAL_OUTPUT_TIMEOUT_MS ) ;
16201627
16211628 await fixture . run . write ( "/exit\r" , { delay : false } ) ;
0 commit comments