@@ -677,10 +677,13 @@ it.layer(NodeServices.layer)("Antigravity Agent Platform credentials", (it) => {
677677 const sdkConfig = path . join ( userHome , "sdk-config" ) ;
678678 yield * fs . makeDirectory ( sdkConfig ) ;
679679 yield * fs . makeDirectory ( path . join ( userHome , ".config" , "gcloud" ) , { recursive : true } ) ;
680- yield * fs . writeFileString (
681- path . join ( userHome , ".config" , "gcloud" , "application_default_credentials.json" ) ,
682- "{}" ,
680+ const adcPath = path . join (
681+ userHome ,
682+ ".config" ,
683+ "gcloud" ,
684+ "application_default_credentials.json" ,
683685 ) ;
686+ yield * fs . writeFileString ( adcPath , "{}" ) ;
684687 const auth : AntigravityAuthConfig = {
685688 authMethod : "agent-platform" ,
686689 apiKey : "" ,
@@ -699,12 +702,13 @@ it.layer(NodeServices.layer)("Antigravity Agent Platform credentials", (it) => {
699702 onGoogleCloud : Effect . succeed ( onGoogleCloud ) ,
700703 } ) ;
701704
702- // CLOUDSDK_CONFIG replaces ~/.config/gcloud, as it does for gcloud.
705+ // The bundled Go harness ignores CLOUDSDK_CONFIG when finding ADC.
706+ expect ( yield * issueWith ( { CLOUDSDK_CONFIG : sdkConfig } ) ) . toBeNull ( ) ;
707+ yield * fs . writeFileString ( path . join ( sdkConfig , "application_default_credentials.json" ) , "{}" ) ;
708+ yield * fs . remove ( adcPath ) ;
703709 expect ( yield * issueWith ( { CLOUDSDK_CONFIG : sdkConfig } ) ) . toContain (
704710 "gcloud auth application-default login" ,
705711 ) ;
706- yield * fs . writeFileString ( path . join ( sdkConfig , "application_default_credentials.json" ) , "{}" ) ;
707- expect ( yield * issueWith ( { CLOUDSDK_CONFIG : sdkConfig } ) ) . toBeNull ( ) ;
708712 expect (
709713 yield * issueWith ( {
710714 CLOUDSDK_CONFIG : path . join ( userHome , "missing" ) ,
@@ -722,6 +726,7 @@ it.layer(NodeServices.layer)("Antigravity Agent Platform credentials", (it) => {
722726 ) ,
723727 ) . toBeNull ( ) ;
724728
729+ yield * fs . writeFileString ( adcPath , "{}" ) ;
725730 // Windows reads %APPDATA%\gcloud and never the POSIX path.
726731 expect ( yield * issueWith ( { APPDATA : userHome } , "win32" ) ) . toContain (
727732 "gcloud auth application-default login" ,
@@ -733,6 +738,7 @@ it.layer(NodeServices.layer)("Antigravity Agent Platform credentials", (it) => {
733738 ) ;
734739 expect ( yield * issueWith ( { APPDATA : userHome } , "win32" ) ) . toBeNull ( ) ;
735740
741+ yield * fs . remove ( adcPath ) ;
736742 // A metadata server supplies credentials without any local file.
737743 const missing = { CLOUDSDK_CONFIG : path . join ( userHome , "missing" ) } ;
738744 expect ( yield * issueWith ( missing , "linux" ) ) . toContain ( "gcloud auth application-default login" ) ;
0 commit comments