@@ -129,6 +129,7 @@ type ProbeError = EffectAcpErrors.AcpError | ProviderSetupError;
129129
130130const makeHarness = Effect . fn ( "makeAntigravityProviderHarness" ) ( function * (
131131 options : {
132+ readonly auth ?: { readonly type : string ; readonly label : string } ;
132133 readonly enabled ?: boolean ;
133134 readonly safe ?: boolean ;
134135 readonly probeUsage ?: Effect . Effect < ServerProviderUsageLimits > ;
@@ -145,6 +146,7 @@ const makeHarness = Effect.fn("makeAntigravityProviderHarness")(function* (
145146 decodeSettings ( { enabled : options . enabled ?? true , customModels : [ "do-not-seed-me" ] } ) ,
146147 {
147148 stampIdentity : ( snapshot ) => Effect . succeed ( { ...snapshot , instanceId, driver } ) ,
149+ ...( options . auth ? { auth : options . auth } : { } ) ,
148150 ...( options . probeUsage ? { probeUsage : options . probeUsage } : { } ) ,
149151 probe : Ref . update ( probeCalls , ( count ) => count + 1 ) . pipe (
150152 Effect . andThen ( Ref . get ( probe ) ) ,
@@ -305,23 +307,35 @@ it.layer(layerTest)("Antigravity provider snapshots", (it) => {
305307 it . effect ( "treats initialize as installation proof, not account or model discovery" , ( ) =>
306308 Effect . scoped (
307309 Effect . gen ( function * ( ) {
308- const harness = yield * makeHarness ( ) ;
309- expect ( yield * harness . provider . snapshot . getSnapshot ) . toMatchObject ( {
310- installed : false ,
311- status : "warning" ,
312- auth : { status : "unknown" } ,
313- models : [ ] ,
314- } ) ;
315- yield * harness . initialize ;
316- const snapshot = yield * harness . provider . snapshot . getSnapshot ;
317- expect ( snapshot ) . toMatchObject ( {
318- installed : true ,
319- status : "warning" ,
320- version : "agy_acp_server_20260818_01_RC01" ,
321- auth : { status : "unknown" } ,
322- models : [ ] ,
323- } ) ;
324- expect ( yield * Ref . get ( harness . probeCalls ) ) . toBe ( 1 ) ;
310+ for ( const auth of [
311+ undefined ,
312+ { type : "oauth-personal" , label : "Google account" } ,
313+ { type : "oauth-business" , label : "Gemini Enterprise" } ,
314+ { type : "gemini-api-key" , label : "Gemini API key" } ,
315+ { type : "agent-platform" , label : "Agent Platform" } ,
316+ ] ) {
317+ const harness = yield * makeHarness ( auth ? { auth } : { } ) ;
318+ expect ( yield * harness . provider . snapshot . getSnapshot ) . toMatchObject ( {
319+ installed : false ,
320+ status : "warning" ,
321+ auth : { status : "unknown" } ,
322+ models : [ ] ,
323+ } ) ;
324+ yield * harness . initialize ;
325+ const snapshot = yield * harness . provider . snapshot . getSnapshot ;
326+ expect ( snapshot ) . toMatchObject ( {
327+ installed : true ,
328+ status : "warning" ,
329+ version : "agy_acp_server_20260818_01_RC01" ,
330+ auth : { status : "unknown" , ...( auth ? { type : auth . type } : { } ) } ,
331+ message :
332+ auth ?. type === "gemini-api-key" || auth ?. type === "agent-platform"
333+ ? `Antigravity is installed. Connect with ${ auth . label } to load models.`
334+ : "Antigravity is installed. Google account access is not checked yet." ,
335+ models : [ ] ,
336+ } ) ;
337+ expect ( yield * Ref . get ( harness . probeCalls ) ) . toBe ( 1 ) ;
338+ }
325339 } ) ,
326340 ) ,
327341 ) ;
@@ -360,7 +374,8 @@ it.layer(layerTest)("Antigravity provider snapshots", (it) => {
360374 it . effect ( "clears all account metadata on sign-out and authentication failure" , ( ) =>
361375 Effect . scoped (
362376 Effect . gen ( function * ( ) {
363- const harness = yield * makeHarness ( ) ;
377+ const auth = { type : "gemini-api-key" , label : "Gemini API key" } ;
378+ const harness = yield * makeHarness ( { auth } ) ;
364379 yield * harness . initialize ;
365380 for ( const clear of [ harness . provider . onSignedOut , harness . provider . onAuthRequired ] ) {
366381 yield * harness . provider . onSessionStarted ( started , "/workspace" ) ;
@@ -369,7 +384,8 @@ it.layer(layerTest)("Antigravity provider snapshots", (it) => {
369384 expect ( yield * harness . provider . snapshot . getSnapshot ) . toMatchObject ( {
370385 installed : true ,
371386 status : "warning" ,
372- auth : { status : "unauthenticated" } ,
387+ auth : { status : "unauthenticated" , type : auth . type , label : auth . label } ,
388+ message : "Connect with Gemini API key to use Antigravity and load models." ,
373389 models : [ ] ,
374390 slashCommands : [ ] ,
375391 skills : [ ] ,
@@ -382,7 +398,14 @@ it.layer(layerTest)("Antigravity provider snapshots", (it) => {
382398 expect ( ( yield * harness . provider . snapshot . getSnapshot ) . models ) . toEqual ( [ ] ) ;
383399 }
384400 const refreshed = yield * harness . provider . snapshot . refresh ;
385- expect ( refreshed . auth . status ) . toBe ( "unauthenticated" ) ;
401+ expect ( refreshed . auth ) . toEqual ( {
402+ status : "unauthenticated" ,
403+ type : auth . type ,
404+ label : auth . label ,
405+ } ) ;
406+ expect ( refreshed . message ) . toBe (
407+ "Connect with Gemini API key to use Antigravity and load models." ,
408+ ) ;
386409 expect ( refreshed . supportsTextGeneration ) . toBe ( false ) ;
387410 } ) ,
388411 ) ,
0 commit comments