@@ -38,7 +38,10 @@ import {
3838} from "../acp/AntigravityAcpSupport.ts" ;
3939import type { AcpSessionRuntime , AcpSessionRuntimeStartResult } from "../acp/AcpSessionRuntime.ts" ;
4040import type { ServerProviderDraft } from "../providerSnapshot.ts" ;
41- import { removeAntigravitySessionFiles } from "../acp/AntigravitySessionFiles.ts" ;
41+ import {
42+ cleanOrphanedAntigravityTempDirs ,
43+ removeAntigravitySessionFiles ,
44+ } from "../acp/AntigravitySessionFiles.ts" ;
4245import { ProviderDriverError } from "../Errors.ts" ;
4346import { makeAntigravityAdapter } from "../Layers/AntigravityAdapter.ts" ;
4447import { makeAntigravityProvider } from "../Layers/AntigravityProvider.ts" ;
@@ -98,6 +101,11 @@ export const AntigravityDriver: ProviderDriver<AntigravitySettings, AntigravityD
98101 serverConfig . stateDir ,
99102 instanceId ,
100103 ) ;
104+ yield * cleanOrphanedAntigravityTempDirs ( profileDirectory ) . pipe (
105+ Effect . provideService ( FileSystem . FileSystem , fileSystem ) ,
106+ Effect . provideService ( Path . Path , path ) ,
107+ Effect . ignore ,
108+ ) ;
101109 const continuationIdentity = defaultProviderContinuationIdentity ( {
102110 driverKind : DRIVER ,
103111 instanceId,
@@ -258,24 +266,47 @@ export const AntigravityDriver: ProviderDriver<AntigravitySettings, AntigravityD
258266 // Kick the TTL-gated manifest refresh alongside the health check, as
259267 // Codex and Claude do. Without it an environment that only runs
260268 // Antigravity would keep classifying against a stale disk cache.
269+ // Antigravity's binary is a PyInstaller single-file bundle. Spawning it
270+ // extracts ~860 MB of files to a temporary directory on every run.
271+ // The health probe only needs to verify that the executable and harness
272+ // exist on disk and resolve the installed version; actual ACP sessions
273+ // and explicit model refreshes spawn the runtime when needed.
261274 const probe = Effect . gen ( function * ( ) {
262275 yield * modelManifest . refreshInBackground ;
263- const processScope = yield * Scope . make ( ) ;
264- yield * Effect . addFinalizer ( ( exit ) => Scope . close ( processScope , exit ) ) ;
265- return yield * authFlow
266- . withProcess (
267- Scope . close ( processScope , Exit . void ) ,
268- Effect . gen ( function * ( ) {
269- const runtime = yield * makeRuntime ( {
270- cwd : serverConfig . stateDir ,
271- clientInfo : { name : "t3-code-provider-probe" , version : "0.0.0" } ,
272- mcpServers : [ ] ,
273- } ) ;
274- return yield * runtime . initialize ( ) ;
275- } ) ,
276- )
277- . pipe ( Effect . provideService ( Scope . Scope , processScope ) ) ;
278- } ) . pipe ( Effect . scoped ) ;
276+ if ( authConfigIssue !== null ) {
277+ return yield * new ProviderSetupError ( {
278+ instanceId,
279+ operation : "configure" ,
280+ detail : authConfigIssue ,
281+ } ) ;
282+ }
283+ const executable = yield * installation
284+ . resolve ( settings . binaryPath , processEnvironment )
285+ . pipe (
286+ Effect . mapError (
287+ ( cause ) =>
288+ new ProviderSetupError ( {
289+ instanceId,
290+ operation : "resolve" ,
291+ detail : cause . detail ,
292+ } ) ,
293+ ) ,
294+ ) ;
295+ return {
296+ protocolVersion : 1 ,
297+ agentCapabilities : {
298+ loadSession : true ,
299+ promptCapabilities : { image : true , audio : true , embeddedContext : true } ,
300+ sessionCapabilities : { list : { } , resume : { } } ,
301+ } ,
302+ authMethods : [ { id : "oauth-personal" , name : "Log in with Google" } ] ,
303+ agentInfo : {
304+ name : "antigravity-acp" ,
305+ title : "Google Antigravity" ,
306+ version : executable . version ?? "unknown" ,
307+ } ,
308+ } ;
309+ } ) ;
279310
280311 const provider = yield * makeAntigravityProvider ( settings , {
281312 stampIdentity : classifyModels ,
0 commit comments