From 29da082724a73e96dabfc8c21d50047c8a3203b0 Mon Sep 17 00:00:00 2001 From: Marve10s Date: Wed, 9 Sep 2026 15:28:16 +0300 Subject: [PATCH 1/2] fix(server): distinguish the Antigravity CLI from the missing ACP runtime --- .../src/provider/AntigravityInstallation.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/apps/server/src/provider/AntigravityInstallation.ts b/apps/server/src/provider/AntigravityInstallation.ts index ebcbd496ee3e..d3eb826711da 100644 --- a/apps/server/src/provider/AntigravityInstallation.ts +++ b/apps/server/src/provider/AntigravityInstallation.ts @@ -400,6 +400,17 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma .map((directory) => path.resolve(directory, binary)); }; + const cliOnPath = Effect.fn("AntigravityInstallation.cliOnPath")(function* ( + processEnvironment?: NodeJS.ProcessEnv, + ) { + for (const name of platform === "win32" ? ["agy.exe", "agy.cmd"] : ["agy"]) { + for (const candidate of pathCandidates(name, processEnvironment)) { + if (yield* executableFile(candidate)) return true; + } + } + return false; + }); + const resolve: AntigravityInstallationService["resolve"] = Effect.fn( "AntigravityInstallation.resolve", )( @@ -427,6 +438,12 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma const selected = yield* fromExternal(candidate, "path"); if (selected) return selected; } + if (releaseAsset && (yield* cliOnPath(processEnvironment))) { + return yield* installationError( + "resolve", + "The Antigravity CLI is installed, but T3 Code runs the separate Antigravity ACP agent. Install it in this environment or set a custom executable path.", + ); + } return yield* installationError( "resolve", releaseAsset From 70d232fc5a8c3ef056f1f821a21c974df79bc205 Mon Sep 17 00:00:00 2001 From: Marve10s Date: Wed, 9 Sep 2026 15:36:16 +0300 Subject: [PATCH 2/2] fix(server): resolve the Antigravity CLI with the shared command resolver --- .../provider/AntigravityInstallation.test.ts | 28 +++++++++++++++++++ .../src/provider/AntigravityInstallation.ts | 17 +++++------ 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/apps/server/src/provider/AntigravityInstallation.test.ts b/apps/server/src/provider/AntigravityInstallation.test.ts index 0528cb4972c9..8d56f1980580 100644 --- a/apps/server/src/provider/AntigravityInstallation.test.ts +++ b/apps/server/src/provider/AntigravityInstallation.test.ts @@ -761,6 +761,34 @@ it.layer(NodeServices.layer)("Antigravity installation", (it) => { }), ); + it.effect.skipIf(HostProcessPlatform.defaultValue() === "win32")( + "names the Antigravity CLI when only the CLI is on PATH", + () => + Effect.gen(function* () { + const fs = yield* FileSystem.FileSystem; + const path = yield* Path.Path; + const baseDir = yield* fs.makeTempDirectoryScoped({ prefix: "t3-agy-cli-test-" }); + const cliDirectory = path.join(baseDir, "cli"); + const emptyDirectory = path.join(baseDir, "empty"); + yield* fs.makeDirectory(cliDirectory); + yield* fs.makeDirectory(emptyDirectory); + yield* fs.writeFileString(path.join(cliDirectory, "agy"), "cli", { mode: 0o755 }); + const { installation } = yield* makeHarness({ baseDir }); + expect( + yield* installation.resolve(undefined, { PATH: emptyDirectory }).pipe(Effect.flip), + ).toMatchObject({ + detail: + "Antigravity is not installed. Install it in this environment or set a custom executable path.", + }); + expect( + yield* installation.resolve(undefined, { PATH: cliDirectory }).pipe(Effect.flip), + ).toMatchObject({ + detail: + "The Antigravity CLI is installed, but T3 Code runs the separate Antigravity ACP agent. Install it in this environment or set a custom executable path.", + }); + }), + ); + it.effect("keeps leased releases available while new sessions resolve the new release", () => Effect.gen(function* () { const { installation, fs, stagingReleased } = yield* makeHarness({ previous: true }); diff --git a/apps/server/src/provider/AntigravityInstallation.ts b/apps/server/src/provider/AntigravityInstallation.ts index d3eb826711da..c40b2ffa49bd 100644 --- a/apps/server/src/provider/AntigravityInstallation.ts +++ b/apps/server/src/provider/AntigravityInstallation.ts @@ -6,6 +6,7 @@ import { HostProcessEnvironment, HostProcessPlatform, } from "@t3tools/shared/hostProcess"; +import { isCommandAvailable } from "@t3tools/shared/shell"; import * as Clock from "effect/Clock"; import * as Cause from "effect/Cause"; import * as Context from "effect/Context"; @@ -400,16 +401,12 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma .map((directory) => path.resolve(directory, binary)); }; - const cliOnPath = Effect.fn("AntigravityInstallation.cliOnPath")(function* ( - processEnvironment?: NodeJS.ProcessEnv, - ) { - for (const name of platform === "win32" ? ["agy.exe", "agy.cmd"] : ["agy"]) { - for (const candidate of pathCandidates(name, processEnvironment)) { - if (yield* executableFile(candidate)) return true; - } - } - return false; - }); + const cliOnPath = (processEnvironment = environment) => + isCommandAvailable("agy", { env: processEnvironment }).pipe( + Effect.provideService(HostProcessPlatform, platform), + Effect.provideService(FileSystem.FileSystem, fs), + Effect.provideService(Path.Path, path), + ); const resolve: AntigravityInstallationService["resolve"] = Effect.fn( "AntigravityInstallation.resolve",