@@ -61,7 +61,7 @@ const makeHarness = Effect.fn("makeAuthTestHarness")(function* (
6161 } = { } ,
6262) {
6363 const authenticated = yield * Deferred . make < void , AcpErrors . AcpError > ( ) ;
64- const discovered = yield * Deferred . make < void > ( ) ;
64+ const discovered = yield * Deferred . make < void , AcpErrors . AcpError > ( ) ;
6565 const closed = yield * Deferred . make < void > ( ) ;
6666 const events : string [ ] = [ ] ;
6767 let receiveAuthorizationUrl :
@@ -224,6 +224,33 @@ it.layer(NodeServices.layer)("AntigravityAuth", (it) => {
224224 } ) ,
225225 ) ;
226226
227+ it . effect (
228+ "distinguishes a post-authentication session failure without exposing its payload" ,
229+ ( ) =>
230+ Effect . gen ( function * ( ) {
231+ const harness = yield * makeHarness ( ) ;
232+ yield * harness . auth . controller . start ( owner ) ;
233+ yield * phase ( harness . auth , "waiting" ) ;
234+ yield * Deferred . succeed ( harness . authenticated , undefined ) ;
235+ yield * Deferred . fail (
236+ harness . discovered ,
237+ new AcpErrors . AcpRequestError ( {
238+ code : - 32603 ,
239+ errorMessage : `Internal error ${ callbackUrl } ` ,
240+ method : "session/new" ,
241+ } ) ,
242+ ) ;
243+ const failed = yield * phase ( harness . auth , "failed" ) ;
244+ assert . equal (
245+ failed . message ,
246+ "Antigravity authenticated, but could not initialize a session or load models." ,
247+ ) ;
248+ assert . isNull ( failed . authorizationUrl ) ;
249+ assert . deepEqual ( harness . catalog ( ) , [ "previous-account-model" ] ) ;
250+ yield * Deferred . await ( harness . closed ) ;
251+ } ) ,
252+ ) ;
253+
227254 it . effect ( "does not call callback HTTP success a successful Google sign-in" , ( ) =>
228255 Effect . gen ( function * ( ) {
229256 const harness = yield * makeHarness ( ) ;
0 commit comments