From 9d0f095020e47ebeafa179673cd68645a7f5ec31 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 19 Nov 2026 04:46:48 +0000 Subject: [PATCH 01/11] test(server): Antigravity below 1.5 is broken and 1.5.12 is recommended Fails on main: the bundled manifest lists 1.4.5, 1.4.1, 1.3.0 and 1.1.1 as supported and recommends >=1.5.1 <2. Co-Authored-By: Claude Opus 5.5 --- .../src/provider/providerCompatibility.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apps/server/src/provider/providerCompatibility.test.ts b/apps/server/src/provider/providerCompatibility.test.ts index ed722b7c53515..6b12e4a6b73f8 100644 --- a/apps/server/src/provider/providerCompatibility.test.ts +++ b/apps/server/src/provider/providerCompatibility.test.ts @@ -147,6 +147,18 @@ describe("provider compatibility", () => { }, ); + it("marks Antigravity below 1.5 broken and recommends 1.5.12 in the bundled manifest", () => { + const policies = decodeCompatibilityPolicies(bundledManifest.compatibility); + const antigravity = ProviderDriverKind.make("antigravity"); + for (const version of ["1.1.1", "1.3.0", "1.4.1", "1.4.5", "1.4.9"]) { + const advisory = resolveProviderCompatibility(policies, antigravity, version); + assert.strictEqual(advisory?.status, "broken", version); + } + const supported = resolveProviderCompatibility(policies, antigravity, "1.5.11"); + assert.strictEqual(supported?.status, "supported"); + assert.strictEqual(supported?.recommendedRange, ">=1.5.12 <2"); + }); + it("classifies boundaries and treats unlisted versions and release tags as unknown", () => { for (const [version, expected] of [ ["0.9.9", "broken"], From ed326b029a94815719c43feaa811fa53180b776c Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 19 Nov 2026 05:19:28 +0000 Subject: [PATCH 02/11] fix(server): refuse Antigravity runtimes below 1.5 The bundled policy listed 1.1.1 through 1.4.5 as supported, and only the managed runtime was checked against it: a custom Binary path or agy on PATH has no version until it answers initialize, so a 1.4.5 runtime ran turns with no warning. Mark everything below 1.5.0 broken and recommend >=1.5.12 <2. The driver's runtime start now reads agentInfo.version from initialize and refuses a broken version before session/new, for managed, custom and PATH executables alike, naming the version and what to update. Co-Authored-By: Claude Opus 5.5 --- .../src/provider/AntigravityInstallation.ts | 21 ++++++-- .../Drivers/AntigravityDriver.test.ts | 49 +++++++++++++++++++ .../src/provider/Drivers/AntigravityDriver.ts | 36 ++++++++++---- apps/server/src/provider/model-manifest.json | 9 ++-- .../provider/providerCompatibility.test.ts | 25 +++++----- 5 files changed, 107 insertions(+), 33 deletions(-) diff --git a/apps/server/src/provider/AntigravityInstallation.ts b/apps/server/src/provider/AntigravityInstallation.ts index 5a33552ac4263..0e5c0fcd8a96e 100644 --- a/apps/server/src/provider/AntigravityInstallation.ts +++ b/apps/server/src/provider/AntigravityInstallation.ts @@ -5,7 +5,11 @@ import { resolveProviderCompatibility } from "./providerCompatibility.ts"; import { cliArchiveTarCommand } from "@t3tools/shared/cliRelease"; import { compareSemverVersions } from "@t3tools/shared/semver"; import * as EffectNodeStream from "@effect/platform-node/NodeStream"; -import { ProviderDriverKind, type ProviderInstallState } from "@t3tools/contracts"; +import { + ProviderDriverKind, + type ProviderInstallState, + type ServerProviderCompatibilityAdvisory, +} from "@t3tools/contracts"; import * as HostProcess from "@t3tools/shared/HostProcess"; import { resolveNodeExecutable, nodeRuntimeUnavailableMessage } from "@t3tools/shared/nodeRuntime"; import { resolveCommandPath } from "@t3tools/shared/shell"; @@ -108,6 +112,9 @@ interface AntigravityInstallationService { binaryPath?: string, environment?: NodeJS.ProcessEnv, ) => Effect.Effect; + readonly compatibility: ( + version: string, + ) => Effect.Effect; readonly start: Effect.Effect; readonly cancel: ( operationId: string, @@ -222,16 +229,21 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma message: null, }); - const isWithdrawn = Effect.fn("AntigravityInstallation.isWithdrawn")(function* (version: string) { + const compatibility = Effect.fn("AntigravityInstallation.compatibility")(function* ( + version: string, + ) { const manifest = yield* manifestService.current; - const status = ( + return ( resolveProviderCompatibility(manifest.compatibility, DRIVER, version) ?? resolveProviderCompatibility( ModelManifest.BUNDLED_MODEL_MANIFEST.compatibility, DRIVER, version, ) - )?.status; + ); + }); + const isWithdrawn = Effect.fn("AntigravityInstallation.isWithdrawn")(function* (version: string) { + const status = (yield* compatibility(version))?.status; return status === "broken" || status === "unsupported"; }); const ensureEligible = Effect.fn("AntigravityInstallation.ensureEligible")(function* ( @@ -1194,6 +1206,7 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma managedDirectory, resolve, acquire, + compatibility, start, cancel, state: SubscriptionRef.get(state), diff --git a/apps/server/src/provider/Drivers/AntigravityDriver.test.ts b/apps/server/src/provider/Drivers/AntigravityDriver.test.ts index fe33021057651..61dfcf62c7f5a 100644 --- a/apps/server/src/provider/Drivers/AntigravityDriver.test.ts +++ b/apps/server/src/provider/Drivers/AntigravityDriver.test.ts @@ -4,6 +4,7 @@ import { expect, it } from "@effect/vitest"; import { ANTIGRAVITY_DEFAULT_MODEL, EnvironmentId, + ProviderDriverKind, ProviderInstanceId, ProviderSessionId, ThreadId, @@ -32,6 +33,8 @@ import * as McpProviderSessions from "@t3tools/provider-core/server/McpProviderS import * as ModelManifest from "../ModelManifest.ts"; import * as IdAllocator from "@t3tools/provider-core/server/IdAllocator"; import * as ProviderAdapter from "@t3tools/provider-core/server/ProviderAdapter"; +import { knownProviderFailureMessage } from "@t3tools/provider-core/server/failure"; +import { resolveProviderCompatibility } from "../providerCompatibility.ts"; import { AntigravityDriver } from "./AntigravityDriver.ts"; import * as ProviderHostLive from "../ProviderHostLive.ts"; import * as ServerSecretStore from "../../auth/ServerSecretStore.ts"; @@ -88,6 +91,7 @@ const makeHarness = Effect.fn("makeAntigravityDriverHarness")(function* ( /** `data` of the agent's "Internal error" response to `session/new`. */ readonly newSessionErrorData?: unknown; readonly initialMode?: string; + readonly agentVersion?: string; } = {}, ) { const directory = path.join(root, name); @@ -111,6 +115,7 @@ const makeHarness = Effect.fn("makeAntigravityDriverHarness")(function* ( ...(options.initialMode === undefined ? [] : [`export T3_ACP_INITIAL_MODE=${shellQuote(options.initialMode)}`]), + `export T3_ACP_AGENT_VERSION=${shellQuote(options.agentVersion ?? "1.5.12")}`, `exec ${shellQuote(nodePath)} ${shellQuote(mockAgentPath)} "$@"`, "", ].join("\n"), @@ -154,6 +159,14 @@ const makeHarness = Effect.fn("makeAntigravityDriverHarness")(function* ( const layerInstallation = Layer.mock(AntigravityInstallation.AntigravityInstallation)({ managedDirectory: root, + compatibility: (version) => + Effect.succeed( + resolveProviderCompatibility( + ModelManifest.BUNDLED_MODEL_MANIFEST.compatibility, + ProviderDriverKind.make("antigravity"), + version, + ), + ), resolve: () => Effect.gen(function* () { if (controls.failResolution) { @@ -529,6 +542,42 @@ it.layer(layerTest)("AntigravityDriver", (it) => { }), ); + it.effect.skipIf(windowsHost)( + "refuses to open a session on a PATH executable older than 1.5", + () => + Effect.gen(function* () { + const h = yield* makeHarness(); + const old = yield* h.makeExecutable("runtime old", { agentVersion: "1.4.5" }); + h.controls.selected = { ...old, source: "path", version: null }; + const threadId = ThreadId.make("thread-antigravity-old-runtime"); + const modelSelection = { instanceId: h.instance.instanceId, model: "gemini-test-low" }; + const error = yield* Effect.scoped( + Effect.gen(function* () { + const workspace = yield* h.fs.makeTempDirectoryScoped({ prefix: "t3-ag-old-runtime-" }); + const runtimePolicy = ProviderAdapter.ProviderAdapterV2RuntimePolicy.make({ + runtimeMode: "approval-required", + interactionMode: "default", + cwd: workspace, + }); + const session = yield* h.instance.orchestrationAdapter.openSession({ + threadId, + providerSessionId: ProviderSessionId.make("provider-session-antigravity-old-runtime"), + modelSelection, + runtimePolicy, + }); + yield* session.ensureThread({ threadId, modelSelection, runtimePolicy }); + }), + ).pipe(Effect.flip); + expect(knownProviderFailureMessage(error)).toBe( + `Antigravity 1.4.5 does not work with this T3 Code release. Update the Antigravity executable at ${old.executablePath} to >=1.5.12 <2, then retry.`, + ); + const methods = (yield* h.readRequests).map((request) => request.method); + expect(methods).toContain("initialize"); + expect(methods).not.toContain("session/new"); + yield* h.assertClosed; + }), + ); + it.effect.skipIf(windowsHost)( "closes refresh processes and clears account metadata when Google sign-in is required", () => diff --git a/apps/server/src/provider/Drivers/AntigravityDriver.ts b/apps/server/src/provider/Drivers/AntigravityDriver.ts index 2491b5ef46442..0efd595192038 100644 --- a/apps/server/src/provider/Drivers/AntigravityDriver.ts +++ b/apps/server/src/provider/Drivers/AntigravityDriver.ts @@ -291,22 +291,40 @@ export const AntigravityDriver: ProviderDriver< runtimeTempDirectory, }), }).pipe(Effect.provideService(SecureRandom.SecureRandom, random)); + // A custom or PATH executable has no version until it answers initialize. + const startCompatible = Effect.fn("AntigravityDriver.startCompatible")(function* () { + const version = (yield* runtime.initialize()).agentInfo?.version; + const advisory = version ? yield* installation.compatibility(version) : undefined; + if (advisory?.status === "broken") { + const target = + advisory.recommendedVersion ?? advisory.recommendedRange ?? "a newer version"; + const update = + executable.source === "managed" + ? `Update it in Antigravity setup to ${target}` + : `Update the Antigravity executable at ${executable.executablePath} to ${target}`; + const cause = new ProviderSetupError({ + instanceId, + operation: "runtime", + detail: `Antigravity ${version} does not work with this T3 Code release. ${update}, then retry.`, + }); + return yield* new AcpErrors.AcpTransportError({ detail: cause.detail, cause }); + } + return yield* runtime.start(); + }); return { ...runtime, ...(executable.harnessPath === null ? { setMode: (modeId: string) => runtime.setMode(antigravityCliSessionMode(modeId)) } : {}), start: () => - runtime - .start() - .pipe( - Effect.tapError((cause): Effect.Effect => - runtimeInput.onAuthorizationUrl === undefined && - isAntigravitySignInRequiredError(cause) - ? provider.onAuthRequired - : Effect.void, - ), + startCompatible().pipe( + Effect.tapError((cause): Effect.Effect => + runtimeInput.onAuthorizationUrl === undefined && + isAntigravitySignInRequiredError(cause) + ? provider.onAuthRequired + : Effect.void, ), + ), }; }); diff --git a/apps/server/src/provider/model-manifest.json b/apps/server/src/provider/model-manifest.json index 01727cc2680b0..977b65968f14b 100644 --- a/apps/server/src/provider/model-manifest.json +++ b/apps/server/src/provider/model-manifest.json @@ -75,13 +75,10 @@ { "driver": "antigravity", "t3CodeRange": ">=0.0.42", - "recommendedRange": ">=1.5.1 <2", + "recommendedRange": ">=1.5.12 <2", "ranges": [ - { "range": ">=1.5.1 <2", "status": "supported" }, - { "range": "=1.4.5", "status": "supported" }, - { "range": "=1.4.1", "status": "supported" }, - { "range": "=1.3.0", "status": "supported" }, - { "range": "=1.1.1", "status": "supported" } + { "range": ">=1.5.0 <2", "status": "supported" }, + { "range": "<1.5.0", "status": "broken" } ] }, { diff --git a/apps/server/src/provider/providerCompatibility.test.ts b/apps/server/src/provider/providerCompatibility.test.ts index 6b12e4a6b73f8..8d81e19f6b5bd 100644 --- a/apps/server/src/provider/providerCompatibility.test.ts +++ b/apps/server/src/provider/providerCompatibility.test.ts @@ -132,20 +132,17 @@ describe("provider compatibility", () => { } }); - it.each(["1.4.5", "1.5.7"])( - "supports the legacy and native Antigravity runtime %s in the bundled manifest", - (version) => { - const policies = decodeCompatibilityPolicies(bundledManifest.compatibility); - assert.strictEqual( - resolveProviderCompatibility( - policies, - ProviderDriverKind.make("antigravity"), - `agy_acp_server_${version}`, - )?.status, - "supported", - ); - }, - ); + it("supports a prefixed native Antigravity runtime in the bundled manifest", () => { + const policies = decodeCompatibilityPolicies(bundledManifest.compatibility); + assert.strictEqual( + resolveProviderCompatibility( + policies, + ProviderDriverKind.make("antigravity"), + "agy_acp_server_1.5.7", + )?.status, + "supported", + ); + }); it("marks Antigravity below 1.5 broken and recommends 1.5.12 in the bundled manifest", () => { const policies = decodeCompatibilityPolicies(bundledManifest.compatibility); From 213efc9f903f24c27eb946755708333cadf78bbc Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 19 Nov 2026 05:42:15 +0000 Subject: [PATCH 03/11] fix(server): advance model manifest updatedAt so cached policies yield to Antigravity 1.5 floor Co-Authored-By: Claude Opus 5.5 --- apps/server/src/provider/ModelManifest.test.ts | 2 ++ apps/server/src/provider/model-manifest.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/server/src/provider/ModelManifest.test.ts b/apps/server/src/provider/ModelManifest.test.ts index 0b4c4c062dca5..0aac6b4968a36 100644 --- a/apps/server/src/provider/ModelManifest.test.ts +++ b/apps/server/src/provider/ModelManifest.test.ts @@ -377,6 +377,8 @@ describe("ModelManifest service", () => { for (const stale of [ undatedManifest, { ...REMOTE_MANIFEST, updatedAt: "2000-01-01T00:00:00Z" }, + // The last bundle before Antigravity below 1.5 became broken. + { ...REMOTE_MANIFEST, updatedAt: "2026-11-14T15:58:47Z" }, ]) { yield* fs.writeFileString( cachePath, diff --git a/apps/server/src/provider/model-manifest.json b/apps/server/src/provider/model-manifest.json index 977b65968f14b..49dcc07866eba 100644 --- a/apps/server/src/provider/model-manifest.json +++ b/apps/server/src/provider/model-manifest.json @@ -1,6 +1,6 @@ { "version": 1, - "updatedAt": "2026-11-14T15:58:47Z", + "updatedAt": "2026-11-19T00:00:00Z", "compatibility": [ { "driver": "codex", From cb553785a4c164f58a55bf822fc97a7de49e672a Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 19 Nov 2026 06:03:01 +0000 Subject: [PATCH 04/11] refactor(server): remove Antigravity code for runtimes below 1.5 Runtimes below 1.5 can no longer start a session, so remove what only they used: the 1.4.2-1.4.5 run_workflow SKILL.md filter, the 1.4.5 native-read, linked-video and systemPrompt.append gates, the agy_acp_server + localharness_external managed archive, harness resolution and spawn shape, the agy_acp_server version prefix in compatibility and the web version label, and docs describing 1.4.5. An existing pre-CLI managed install now resolves with an update message and is replaced by the CLI from Antigravity setup. Co-Authored-By: Claude Opus 5.5 --- .../Adapters/AntigravityAdapterV2.test.ts | 13 +- .../Adapters/AntigravityAdapterV2.ts | 12 +- .../provider/AntigravityInstallation.test.ts | 532 +++++++----------- .../src/provider/AntigravityInstallation.ts | 310 +++------- .../src/provider/AntigravityProvider.test.ts | 8 +- .../Drivers/AntigravityDriver.test.ts | 36 +- .../src/provider/Drivers/AntigravityDriver.ts | 4 +- .../src/provider/ProviderRegistry.test.ts | 2 +- .../acp/AntigravityAcpSupport.test.ts | 126 +---- .../src/provider/acp/AntigravityAcpSupport.ts | 81 +-- .../provider/antigravityAuthSupport.test.ts | 38 +- .../src/provider/antigravityAuthSupport.ts | 44 +- .../server/src/provider/antigravityRelease.ts | 14 - apps/server/src/provider/managedRelease.ts | 3 +- .../provider/providerCompatibility.test.ts | 34 -- .../src/provider/providerCompatibility.ts | 10 +- .../src/components/settings/providerStatus.ts | 5 - docs/user/providers-antigravity.md | 12 +- packages/provider-acp/src/server/adapter.ts | 15 - 19 files changed, 342 insertions(+), 957 deletions(-) delete mode 100644 apps/server/src/provider/antigravityRelease.ts diff --git a/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts b/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts index 8a7e4ff193be0..3c3db5520c29c 100644 --- a/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts +++ b/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts @@ -1487,8 +1487,8 @@ describe("AntigravityAdapterV2 runtime mode ceiling", () => { }); describe("AntigravityAdapterV2 session system prompt", () => { - it.effect.each(["1.4.5", "1.4.1"])( - "carries PR linking once in the %s session setup or once per turn", + it.effect.each(["1.5.0"])( + "carries PR linking once per turn on %s, which does not advertise a system prompt append", (agentVersion) => Effect.gen(function* () { const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; @@ -1606,13 +1606,8 @@ describe("AntigravityAdapterV2 session system prompt", () => { const append = JSON.stringify(sessionNew?.params?._meta ?? null); // Identity stays per turn either way. assert.include(sent, "through the Antigravity harness, as gemini-test-low"); - if (agentVersion === "1.4.5") { - assert.include(append, "pull_request_linking"); - assert.notInclude(sent, ""); - } else { - assert.notInclude(append, "systemPrompt"); - assert.include(sent, ""); - } + assert.notInclude(append, "systemPrompt"); + assert.include(sent, ""); }).pipe(Effect.provide(layerSession)), ); }); diff --git a/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.ts b/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.ts index b8fd0bb98ecd4..de41c9141c53f 100644 --- a/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.ts +++ b/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.ts @@ -221,21 +221,12 @@ export function makeAntigravityAcpAdapterFlavor( mcpOverHttp: true, sessionCarriesPullRequestLinking: antigravityAppendsSystemPrompt, makeRuntime, - buildAttachmentPrompt: ({ - text, - attachments, - resolveAttachmentPath, - promptCapabilities, - agentVersion, - currentModel, - }) => + buildAttachmentPrompt: ({ text, attachments, resolveAttachmentPath, promptCapabilities }) => buildAntigravityPrompt({ input: text, attachments, resolveAttachmentPath, promptCapabilities, - agentVersion, - currentModel, }).pipe( Effect.map((blocks) => (text.trim() ? blocks.slice(1) : blocks)), Effect.provideService(FileSystem.FileSystem, options.fileSystem), @@ -295,7 +286,6 @@ export function makeAntigravityAcpAdapterFlavor( requiresSignIn: isAntigravitySignInRequiredError, // Antigravity can leave a prompt open without updates; long tools and approvals pause this. promptInactivityTimeout: "15 minutes", - // 1.4.5 returns the root trajectory's Gemini usageMetadata delta; 1.4.1 returns none. reportsPerTurnPromptUsage: true, geminiPromptUsage: true, ...(profileDirectory === undefined diff --git a/apps/server/src/provider/AntigravityInstallation.test.ts b/apps/server/src/provider/AntigravityInstallation.test.ts index 5635522eab4a6..c7987ad7dbf68 100644 --- a/apps/server/src/provider/AntigravityInstallation.test.ts +++ b/apps/server/src/provider/AntigravityInstallation.test.ts @@ -24,41 +24,24 @@ import * as ChildProcessSpawner from "effect/process/ChildProcessSpawner"; import * as AntigravityInstallation from "./AntigravityInstallation.ts"; import * as ModelManifest from "./ModelManifest.ts"; -import { type AntigravityReleaseAsset } from "./antigravityRelease.ts"; +import { type AntigravityCliReleaseAsset } from "./antigravityCliRelease.ts"; const serverContents = "antigravity runtime\n"; -const harnessContents = "local harness\n"; const previousReleaseId = "1".repeat(64); -const previousVersion = "fixture-old"; +const previousVersion = "1.5.3"; +const assetVersion = "1.5.5"; const encodeJsonString = Schema.encodeSync(Schema.fromJsonString(Schema.Unknown)); - -const zipFixtures = { - complete: - "UEsDBBQAAAAIAAAAIl1zEy/oFAAAABQAAAASAAAAYWd5X2FjcF9zZXJ2ZXIucGFyS8wryUwvSizLLKlUKCoFcnJTuQBQSwMEFAAAAAgAAAAiXV9yAykQAAAADgAAABUAAABsb2NhbGhhcm5lc3NfZXh0ZXJuYWzLyU9OzFHISCzKSy0u5gIAUEsBAhQDFAAAAAgAAAAiXXMTL+gUAAAAFAAAABIAAAAAAAAAAAAAAO2BAAAAAGFneV9hY3Bfc2VydmVyLnBhclBLAQIUAxQAAAAIAAAAIl1fcgMpEAAAAA4AAAAVAAAAAAAAAAAAAADtgUQAAABsb2NhbGhhcm5lc3NfZXh0ZXJuYWxQSwUGAAAAAAIAAgCDAAAAhwAAAAAA", - missingHarness: - "UEsDBBQAAAAIAAAAIl1zEy/oFAAAABQAAAASAAAAYWd5X2FjcF9zZXJ2ZXIucGFyS8wryUwvSizLLKlUKCoFcnJTuQBQSwECFAMUAAAACAAAACJdcxMv6BQAAAAUAAAAEgAAAAAAAAAAAAAA7YEAAAAAYWd5X2FjcF9zZXJ2ZXIucGFyUEsFBgAAAAABAAEAQAAAAEQAAAAAAA==", - duplicate: - "UEsDBBQAAAAIAAAAIl1zEy/oFAAAABQAAAASAAAAYWd5X2FjcF9zZXJ2ZXIucGFyS8wryUwvSizLLKlUKCoFcnJTuQBQSwMEFAAAAAgAAAAiXXMTL+gUAAAAFAAAABIAAABhZ3lfYWNwX3NlcnZlci5wYXJLzCvJTC9KLMssqVQoKgVyclO5AFBLAQIUAxQAAAAIAAAAIl1zEy/oFAAAABQAAAASAAAAAAAAAAAAAADtgQAAAABhZ3lfYWNwX3NlcnZlci5wYXJQSwECFAMUAAAACAAAACJdcxMv6BQAAAAUAAAAEgAAAAAAAAAAAAAA7YFEAAAAYWd5X2FjcF9zZXJ2ZXIucGFyUEsFBgAAAAACAAIAgAAAAIgAAAAAAA==", - traversal: - "UEsDBBQAAAAIAAAAIl1zEy/oFAAAABQAAAAVAAAALi5cYWd5X2FjcF9zZXJ2ZXIucGFyS8wryUwvSizLLKlUKCoFcnJTuQBQSwMEFAAAAAgAAAAiXV9yAykQAAAADgAAABUAAABsb2NhbGhhcm5lc3NfZXh0ZXJuYWzLyU9OzFHISCzKSy0u5gIAUEsBAhQDFAAAAAgAAAAiXXMTL+gUAAAAFAAAABUAAAAAAAAAAAAAAO2BAAAAAC4uXGFneV9hY3Bfc2VydmVyLnBhclBLAQIUAxQAAAAIAAAAIl1fcgMpEAAAAA4AAAAVAAAAAAAAAAAAAADtgUcAAABsb2NhbGhhcm5lc3NfZXh0ZXJuYWxQSwUGAAAAAAIAAgCGAAAAigAAAAAA", - symlink: - "UEsDBBQAAAAIAAAAIl1zEy/oFAAAABQAAAASAAAAYWd5X2FjcF9zZXJ2ZXIucGFyS8wryUwvSizLLKlUKCoFcnJTuQBQSwMEFAAAAAgAAAAiXV9yAykQAAAADgAAABUAAABsb2NhbGhhcm5lc3NfZXh0ZXJuYWzLyU9OzFHISCzKSy0u5gIAUEsBAhQDFAAAAAgAAAAiXXMTL+gUAAAAFAAAABIAAAAAAAAAAAAAAO2BAAAAAGFneV9hY3Bfc2VydmVyLnBhclBLAQIUAxQAAAAIAAAAIl1fcgMpEAAAAA4AAAAVAAAAAAAAAAAAAAD/oUQAAABsb2NhbGhhcm5lc3NfZXh0ZXJuYWxQSwUGAAAAAAIAAgCDAAAAhwAAAAAA", - oversizedMember: - "UEsDBBQAAAAIAAAAIl0WGThFFQAAABUAAAASAAAAYWd5X2FjcF9zZXJ2ZXIucGFyS8wryUwvSizLLKlUKCoFcnJTuSoAUEsDBBQAAAAIAAAAIl1fcgMpEAAAAA4AAAAVAAAAbG9jYWxoYXJuZXNzX2V4dGVybmFsy8lPTsxRyEgsykstLuYCAFBLAQIUAxQAAAAIAAAAIl0WGThFFQAAABUAAAASAAAAAAAAAAAAAADtgQAAAABhZ3lfYWNwX3NlcnZlci5wYXJQSwECFAMUAAAACAAAACJdX3IDKRAAAAAOAAAAFQAAAAAAAAAAAAAA7YFFAAAAbG9jYWxoYXJuZXNzX2V4dGVybmFsUEsFBgAAAAACAAIAgwAAAIgAAAAAAA==", - windows: - "UEsDBBQAAAAIAAAAIl1zEy/oFAAAABQAAAASAAAAYWd5X2FjcF9zZXJ2ZXIuZXhlS8wryUwvSizLLKlUKCoFcnJTuQBQSwMEFAAAAAgAAAAiXV9yAykQAAAADgAAABkAAABsb2NhbGhhcm5lc3NfZXh0ZXJuYWwuZXhly8lPTsxRyEgsykstLuYCAFBLAQIUAxQAAAAIAAAAIl1zEy/oFAAAABQAAAASAAAAAAAAAAAAAADtgQAAAABhZ3lfYWNwX3NlcnZlci5leGVQSwECFAMUAAAACAAAACJdX3IDKRAAAAAOAAAAGQAAAAAAAAAAAAAA7YFEAAAAbG9jYWxoYXJuZXNzX2V4dGVybmFsLmV4ZVBLBQYAAAAAAgACAIcAAACLAAAAAAA=", -}; +// One regular member, `antigravity`, holding serverContents. +const cliTarball = Buffer.from( + "H4sIAAAAAAACE+3RMQ7CQAwEQNe8Ik8wgYj3XIFQCiiOCxK/56CJRA9CYqZZrxsXLpc2n2q5ze0en5LdYZpe2b1n5rhf5+d+m+MuY8j4guXaSu3n4z+V9f9DXXo5HzcBAAAAAAAAAADAz3sA56lbdQAoAAA=", + "base64", +); // Linux platform mocks cannot enforce POSIX exec bits on NTFS; use the host platform. const hostPlatform: NodeJS.Platform = HostProcess.Platform.defaultValue() === "win32" ? "win32" : "linux"; -const completeArchive = Buffer.from( - hostPlatform === "win32" ? zipFixtures.windows : zipFixtures.complete, - "base64", -); -const executableName = hostPlatform === "win32" ? "agy_acp_server.exe" : "agy_acp_server.par"; -const harnessName = - hostPlatform === "win32" ? "localharness_external.exe" : "localharness_external"; +const completeArchive = hostPlatform === "win32" ? Buffer.from(serverContents) : cliTarball; +const executableName = hostPlatform === "win32" ? "agy.exe" : "antigravity"; const releaseAsset = Effect.fn("test.antigravityReleaseAsset")(function* ( archive: Uint8Array = completeArchive, @@ -66,60 +49,51 @@ const releaseAsset = Effect.fn("test.antigravityReleaseAsset")(function* ( ) { const digest = yield* Digest.Digest; return { - version: "fixture-new", - url: "https://dl.google.com/antigravity-test.zip", - sha256: Hex.encode(yield* digest.digest(Digest.sha256, archive).pipe(Effect.orDie)), - archiveBytes: archive.byteLength, - executable: { - name: platform === "win32" ? "agy_acp_server.exe" : "agy_acp_server.par", - bytes: Buffer.byteLength(serverContents), - }, - harness: { - name: platform === "win32" ? "localharness_external.exe" : "localharness_external", - bytes: Buffer.byteLength(harnessContents), - }, - } satisfies AntigravityReleaseAsset; + version: assetVersion, + url: "https://storage.googleapis.com/antigravity-test", + sha512: Hex.encode(yield* digest.digest(Digest.sha512, archive).pipe(Effect.orDie)), + executable: { name: platform === "win32" ? "agy.exe" : "antigravity" }, + format: platform === "win32" ? "executable" : "tar.gz", + } satisfies AntigravityCliReleaseAsset; }); const writeRelease = Effect.fn("test.writeAntigravityRelease")(function* ( managedDirectory: string, - asset: AntigravityReleaseAsset, + release: { readonly releaseId: string; readonly version: string; readonly name: string }, active = true, ) { const fs = yield* FileSystem.FileSystem; const path = yield* Path.Path; - const directory = path.join(managedDirectory, "versions", asset.sha256); + const directory = path.join(managedDirectory, "versions", release.releaseId); yield* fs.makeDirectory(directory, { recursive: true }); - yield* fs.writeFileString(path.join(directory, asset.executable.name), serverContents, { - mode: 0o755, - }); - yield* fs.writeFileString(path.join(directory, asset.harness.name), harnessContents, { - mode: 0o755, - }); + yield* fs.writeFileString(path.join(directory, release.name), serverContents, { mode: 0o755 }); yield* fs.writeFileString( path.join(directory, ".install-complete.json"), encodeJsonString({ - releaseId: asset.sha256, - version: asset.version, - executable: asset.executable, - harness: asset.harness, + releaseId: release.releaseId, + version: release.version, + executable: { name: release.name, bytes: Buffer.byteLength(serverContents) }, }), ); if (active) { yield* fs.writeFileString( path.join(managedDirectory, "active.json"), - encodeJsonString({ releaseId: asset.sha256 }), + encodeJsonString({ releaseId: release.releaseId }), ); } }); +const assetRelease = (asset: AntigravityCliReleaseAsset) => ({ + releaseId: asset.sha512.slice(0, 64), + version: asset.version, + name: asset.executable.name, +}); + interface HarnessOptions { readonly baseDir?: string; - readonly asset?: AntigravityReleaseAsset | null; + readonly asset?: AntigravityCliReleaseAsset | null; readonly archive?: Buffer; readonly body?: Stream.Stream | undefined; - readonly contentLength?: number; - readonly contentEncoding?: string; readonly platform?: NodeJS.Platform; readonly arch?: NodeJS.Architecture; readonly path?: string; @@ -153,9 +127,9 @@ const makeHarness = Effect.fn("test.makeAntigravityInstallation")(function* ( const managedDirectory = path.join(baseDir, "tools", "antigravity-acp", `${platform}-${arch}`); if (options.previous) { yield* writeRelease(managedDirectory, { - ...(yield* releaseAsset(archive, platform)), - sha256: previousReleaseId, + releaseId: previousReleaseId, version: previousVersion, + name: platform === "win32" ? "agy.exe" : "antigravity", }); } const stagingReleased = yield* Deferred.make(); @@ -236,19 +210,7 @@ const makeHarness = Effect.fn("test.makeAntigravityInstallation")(function* ( }), ); } - const response = HttpClientResponse.fromWeb( - request, - new Response(null, { - headers: { - ...(options.contentLength === undefined - ? {} - : { "content-length": String(options.contentLength) }), - ...(options.contentEncoding === undefined - ? {} - : { "content-encoding": options.contentEncoding }), - }, - }), - ); + const response = HttpClientResponse.fromWeb(request, new Response(null)); return Effect.succeed( Object.defineProperty(response, "stream", { value: @@ -285,24 +247,45 @@ const expectPreviousRelease = Effect.fn("test.expectPreviousAntigravityRelease") path.join(installation.managedDirectory, "versions", previousReleaseId), ); expect(yield* fs.readFileString(resolved.executablePath)).toBe(serverContents); - expect(yield* fs.readFileString(resolved.harnessPath!)).toBe(harnessContents); expect((yield* installation.state).installedVersion).toBe(previousVersion); }); it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity installation", (it) => { it.effect.each([...new Set(["win32", hostPlatform])] as NodeJS.Platform[])( - "migrates the legacy managed runtime to the native CLI on %s and retains the old release", + "replaces a managed runtime from before the Antigravity CLI on %s", (platform) => Effect.gen(function* () { - const archive = - platform === "win32" - ? Buffer.from(serverContents) - : Buffer.from( - "H4sIAAAAAAACE+3RMQ7CQAwEQNe8Ik8wgYj3XIFQCiiOCxK/56CJRA9CYqZZrxsXLpc2n2q5ze0en5LdYZpe2b1n5rhf5+d+m+MuY8j4guXaSu3n4z+V9f9DXXo5HzcBAAAAAAAAAADAz3sA56lbdQAoAAA=", - "base64", - ); - const { installation, validations, requests, fs, baseDir, stagingReleased } = - yield* makeHarness({ native: true, archive, platform, previous: true }); + const archive = platform === "win32" ? Buffer.from(serverContents) : cliTarball; + const { installation, validations, requests, fs, path, baseDir, stagingReleased } = + yield* makeHarness({ native: true, archive, platform }); + // A 1.4.x install recorded agy_acp_server with its localharness_external sibling. + const legacyId = "2".repeat(64); + const legacyDirectory = path.join(installation.managedDirectory, "versions", legacyId); + yield* fs.makeDirectory(legacyDirectory, { recursive: true }); + yield* fs.writeFileString( + path.join(legacyDirectory, "agy_acp_server.par"), + serverContents, + { + mode: 0o755, + }, + ); + yield* fs.writeFileString( + path.join(legacyDirectory, ".install-complete.json"), + encodeJsonString({ + releaseId: legacyId, + version: "1.4.5", + executable: { name: "agy_acp_server.par", bytes: Buffer.byteLength(serverContents) }, + harness: { name: "localharness_external", bytes: 1 }, + }), + ); + yield* fs.writeFileString( + path.join(installation.managedDirectory, "active.json"), + encodeJsonString({ releaseId: legacyId }), + ); + expect(yield* installation.resolve().pipe(Effect.flip)).toMatchObject({ + operation: "resolve", + detail: expect.stringContaining("Update it in Antigravity setup"), + }); yield* installation.start; expect(yield* terminalState(installation)).toMatchObject({ phase: "succeeded", @@ -310,8 +293,9 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst }); yield* Deferred.await(stagingReleased); const resolved = yield* installation.resolve(); - expect(resolved).toMatchObject({ source: "managed", version: "1.5.7", harnessPath: null }); - expect(validations[0]?.executable.harnessPath).toBeNull(); + expect(resolved).toMatchObject({ source: "managed", version: "1.5.7" }); + expect(validations).toHaveLength(1); + expect(yield* fs.exists(legacyDirectory)).toBe(false); expect(yield* fs.readFileString(resolved.executablePath)).toBe(serverContents); expect(requests.some((url) => url.includes("/manifests/"))).toBe(true); const restarted = yield* makeHarness({ @@ -523,9 +507,9 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst url: "https://example.com/agy.exe", }), }, - ])("rejects a native $name and preserves the legacy release", ({ change }) => + ])("rejects a native $name and preserves the previous release", ({ change }) => Effect.gen(function* () { - const { installation, validations } = yield* makeHarness({ + const { installation, validations, requests } = yield* makeHarness({ native: true, nativeManifest: change, archive: Buffer.from(serverContents), @@ -533,9 +517,10 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst previous: true, }); const result = yield* Effect.result(installation.start); - if (result._tag === "Success") - expect((yield* terminalState(installation)).phase).toBe("failed"); - expect(validations).toEqual([]); + // Without an acceptable release, start re-verifies the installed one. + if (result._tag === "Success") yield* terminalState(installation); + expect(validations.map(({ version }) => version)).not.toContain("1.5.7"); + expect(requests.some((url) => url.startsWith("https://example.com"))).toBe(false); yield* expectPreviousRelease(installation); }), ); @@ -553,7 +538,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst }).pipe(Effect.provideService(HostProcess.IsExecutable, true)), ); - it.effect("verifies both files before activating a streamed download", () => + it.effect("verifies the executable before activating a streamed download", () => Effect.gen(function* () { const enteredValidation = yield* Deferred.make(); const finishValidation = yield* Deferred.make(); @@ -576,59 +561,35 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst yield* Deferred.await(enteredValidation); yield* expectPreviousRelease(installation); const validation = validations[0]; - expect(validation?.version).toBe("fixture-new"); + expect(validation?.version).toBe(assetVersion); if (!validation) return yield* Effect.die("Expected runtime validation."); expect(yield* fs.readFileString(validation.executable.executablePath)).toBe(serverContents); - expect(yield* fs.readFileString(validation.executable.harnessPath!)).toBe(harnessContents); yield* Deferred.succeed(finishValidation, undefined); expect(yield* terminalState(installation)).toMatchObject({ phase: "succeeded", operationId: started.operationId, - downloadedBytes: completeArchive.byteLength, - installedVersion: "fixture-new", + installedVersion: assetVersion, }); yield* Deferred.await(stagingReleased); const selected = yield* installation.resolve(); - expect(selected).toMatchObject({ source: "managed", version: "fixture-new" }); - expect(path.dirname(selected.harnessPath!)).toBe(path.dirname(selected.executablePath)); + expect(selected).toMatchObject({ source: "managed", version: assetVersion }); expect(yield* fs.readFileString(selected.executablePath)).toBe(serverContents); - expect(yield* fs.readFileString(selected.harnessPath!)).toBe(harnessContents); expect(yield* fs.readDirectory(path.join(installation.managedDirectory, "versions"))).toEqual( - [(yield* releaseAsset()).sha256], + [assetRelease(yield* releaseAsset()).releaseId], ); expect(requests).toEqual([(yield* releaseAsset()).url]); }), ); - it.effect("accepts an encoded Content-Length when the body is compressed", () => - Effect.gen(function* () { - // dl.google.com reports the gzip-encoded size; byte and hash checks use the decoded stream. - const { installation, validations } = yield* makeHarness({ - contentLength: completeArchive.byteLength - 1_000, - contentEncoding: "gzip", - }); - yield* installation.start; - const state = yield* terminalState(installation); - expect(state.phase).toBe("succeeded"); - expect(validations).toHaveLength(1); - }), - ); - it.effect.each([ - { name: "checksum mismatch", completeAsset: { sha256: "2".repeat(64) } }, + { name: "checksum mismatch", completeAsset: { sha512: "2".repeat(128) } }, { name: "short download", archive: completeArchive.subarray(0, -1), completeAsset: {} }, { name: "oversized download", archive: Buffer.concat([completeArchive, Buffer.from("extra")]), completeAsset: {}, }, - { name: "wrong Content-Length", contentLength: completeArchive.byteLength + 1 }, - { name: "missing harness", archive: Buffer.from(zipFixtures.missingHarness, "base64") }, - { name: "duplicate executable", archive: Buffer.from(zipFixtures.duplicate, "base64") }, - { name: "path traversal", archive: Buffer.from(zipFixtures.traversal, "base64") }, - { name: "symbolic link", archive: Buffer.from(zipFixtures.symlink, "base64") }, - { name: "oversized member", archive: Buffer.from(zipFixtures.oversizedMember, "base64") }, ])("rejects $name before runtime validation", ({ completeAsset, ...options }) => Effect.gen(function* () { const asset = @@ -699,25 +660,6 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst }), ); - it.effect.skipIf(HostProcess.Platform.defaultValue() === "win32")( - "refuses a 16 KiB-page linux-arm64 kernel before downloading the runtime", - () => - Effect.gen(function* () { - const realSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; - const spawner = ChildProcessSpawner.make((command) => - ChildProcess.isStandardCommand(command) && command.command === "getconf" - ? realSpawner.spawn(ChildProcess.make("sh", ["-c", "echo 16384"], command.options)) - : realSpawner.spawn(command), - ); - const { installation, requests } = yield* makeHarness({ arch: "arm64", spawner }); - yield* installation.start; - const state = yield* terminalState(installation); - expect(state.phase).toBe("failed"); - expect(state.message).toMatch(/4 KiB/); - expect(requests).toEqual([]); - }), - ); - it.effect.each(["downloaded", "existing", "concurrent"] as const)( "reports a verification timeout for a %s runtime without changing the active release", (source) => @@ -734,7 +676,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst ...fs, rename: (from, to) => source === "concurrent" && path.basename(path.dirname(to)) === "versions" - ? writeRelease(path.dirname(path.dirname(to)), asset, false).pipe( + ? writeRelease(path.dirname(path.dirname(to)), assetRelease(asset), false).pipe( Effect.provideService(FileSystem.FileSystem, fs), Effect.provideService(Path.Path, path), Effect.andThen( @@ -758,7 +700,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst ), }); if (source === "existing") { - yield* writeRelease(installation.managedDirectory, asset, false); + yield* writeRelease(installation.managedDirectory, assetRelease(asset), false); } yield* installation.start; yield* Deferred.await(entered); @@ -775,97 +717,100 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst }), ); - it.effect.each(["download", "extract", "active pointer"] as const)( - "preserves the old runtime after an ENOSPC error during %s", - (stage) => - Effect.gen(function* () { - const fs = yield* FileSystem.FileSystem; - const noSpace = PlatformError.systemError({ - _tag: "Unknown", - module: "FileSystem", - method: "write", - description: "ENOSPC: no space left on device", - }); - const fileSystem = FileSystem.FileSystem.of({ + // Windows hosts copy the downloaded executable, so no extraction stream exists there. + it.effect.each( + hostPlatform === "win32" + ? (["download", "active pointer"] as const) + : (["download", "extract", "active pointer"] as const), + )("preserves the old runtime after an ENOSPC error during %s", (stage) => + Effect.gen(function* () { + const fs = yield* FileSystem.FileSystem; + const noSpace = PlatformError.systemError({ + _tag: "Unknown", + module: "FileSystem", + method: "write", + description: "ENOSPC: no space left on device", + }); + const fileSystem = FileSystem.FileSystem.of({ + ...fs, + sink: (target, options) => + (stage === "download" && target.endsWith("download")) || + (stage === "extract" && target.endsWith(executableName)) + ? fs.sink(target, options).pipe(Sink.mapInputEffect(() => Effect.fail(noSpace))) + : fs.sink(target, options), + writeFileString: (target, content, options) => + stage === "active pointer" && target.endsWith("contents.tmp") + ? Effect.fail(noSpace) + : fs.writeFileString(target, content, options), + }); + const { installation, stagingReleased, path } = yield* makeHarness({ + previous: true, + fileSystem, + }); + yield* installation.start; + expect((yield* terminalState(installation)).phase).toBe("failed"); + yield* Deferred.await(stagingReleased); + yield* expectPreviousRelease(installation); + expect( + (yield* fs.readDirectory(path.join(installation.managedDirectory, "versions"))).some( + (name) => name.startsWith(".install-"), + ), + ).toBe(false); + expect(yield* fs.readDirectory(installation.managedDirectory)).toEqual([ + "active.json", + "versions", + ]); + }), + ); + + it.effect.each( + hostPlatform === "win32" + ? (["downloading", "verifying"] as const) + : (["downloading", "extracting", "verifying"] as const), + )("cancels during %s and waits for open resources to close", (phase) => + Effect.gen(function* () { + const fs = yield* FileSystem.FileSystem; + const entered = yield* Deferred.make(); + const release = yield* Deferred.make(); + const interrupted = yield* Deferred.make(); + const barrier = Deferred.succeed(entered, undefined).pipe( + Effect.andThen(Deferred.await(release)), + Effect.onInterrupt(() => Deferred.succeed(interrupted, undefined)), + ); + const { installation, stagingReleased, path, validations } = yield* makeHarness({ + previous: true, + body: + phase === "downloading" + ? Stream.concat( + Stream.make(completeArchive.subarray(0, 31)), + Stream.fromEffect(barrier.pipe(Effect.as(completeArchive.subarray(31)))), + ) + : undefined, + validate: phase === "verifying" ? () => barrier : undefined, + fileSystem: FileSystem.FileSystem.of({ ...fs, sink: (target, options) => - (stage === "download" && target.endsWith("download.zip")) || - (stage === "extract" && target.endsWith(executableName)) - ? fs.sink(target, options).pipe(Sink.mapInputEffect(() => Effect.fail(noSpace))) + phase === "extracting" && target.endsWith(executableName) + ? fs + .sink(target, options) + .pipe(Sink.mapInputEffect((chunk: Uint8Array) => barrier.pipe(Effect.as(chunk)))) : fs.sink(target, options), - writeFileString: (target, content, options) => - stage === "active pointer" && target.endsWith("contents.tmp") - ? Effect.fail(noSpace) - : fs.writeFileString(target, content, options), - }); - const { installation, stagingReleased, path } = yield* makeHarness({ - previous: true, - fileSystem, - }); - yield* installation.start; - expect((yield* terminalState(installation)).phase).toBe("failed"); - yield* Deferred.await(stagingReleased); - yield* expectPreviousRelease(installation); - expect( - (yield* fs.readDirectory(path.join(installation.managedDirectory, "versions"))).some( - (name) => name.startsWith(".install-"), - ), - ).toBe(false); - expect(yield* fs.readDirectory(installation.managedDirectory)).toEqual([ - "active.json", - "versions", - ]); - }), - ); - - it.effect.each(["downloading", "extracting", "verifying"] as const)( - "cancels during %s and waits for open resources to close", - (phase) => - Effect.gen(function* () { - const fs = yield* FileSystem.FileSystem; - const entered = yield* Deferred.make(); - const release = yield* Deferred.make(); - const interrupted = yield* Deferred.make(); - const barrier = Deferred.succeed(entered, undefined).pipe( - Effect.andThen(Deferred.await(release)), - Effect.onInterrupt(() => Deferred.succeed(interrupted, undefined)), - ); - const { installation, stagingReleased, path, validations } = yield* makeHarness({ - previous: true, - body: - phase === "downloading" - ? Stream.concat( - Stream.make(completeArchive.subarray(0, 31)), - Stream.fromEffect(barrier.pipe(Effect.as(completeArchive.subarray(31)))), - ) - : undefined, - validate: phase === "verifying" ? () => barrier : undefined, - fileSystem: FileSystem.FileSystem.of({ - ...fs, - sink: (target, options) => - phase === "extracting" && target.endsWith(executableName) - ? fs - .sink(target, options) - .pipe( - Sink.mapInputEffect((chunk: Uint8Array) => barrier.pipe(Effect.as(chunk))), - ) - : fs.sink(target, options), - }), - }); - const started = yield* installation.start; - yield* Deferred.await(entered); - expect((yield* installation.state).phase).toBe(phase); - expect( - (yield* installation.cancel(started.operationId ?? "missing-operation-id")).phase, - ).toBe("cancelled"); - yield* Deferred.await(interrupted); - yield* Deferred.await(stagingReleased); - yield* expectPreviousRelease(installation); - expect(validations).toHaveLength(phase === "verifying" ? 1 : 0); - expect( - yield* fs.readDirectory(path.join(installation.managedDirectory, "versions")), - ).toEqual([previousReleaseId]); - }), + }), + }); + const started = yield* installation.start; + yield* Deferred.await(entered); + expect((yield* installation.state).phase).toBe(phase); + expect( + (yield* installation.cancel(started.operationId ?? "missing-operation-id")).phase, + ).toBe("cancelled"); + yield* Deferred.await(interrupted); + yield* Deferred.await(stagingReleased); + yield* expectPreviousRelease(installation); + expect(validations).toHaveLength(phase === "verifying" ? 1 : 0); + expect(yield* fs.readDirectory(path.join(installation.managedDirectory, "versions"))).toEqual( + [previousReleaseId], + ); + }), ); it.effect.each([ @@ -924,7 +869,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst expect(yield* installation.state).toMatchObject({ operationId: first.operationId, phase: "succeeded", - installedVersion: "fixture-new", + installedVersion: assetVersion, }); const current = testCase.restart ? yield* installation.start : first; if (testCase.restart) yield* Deferred.await(nextValidationStarted); @@ -935,15 +880,15 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst expect(yield* installation.state).toMatchObject({ operationId: current.operationId, phase: testCase.restart ? "verifying" : "succeeded", - installedVersion: "fixture-new", + installedVersion: assetVersion, }); - expect((yield* installation.resolve()).version).toBe("fixture-new"); + expect((yield* installation.resolve()).version).toBe(assetVersion); yield* Deferred.succeed(releaseNextValidation, undefined); expect(yield* terminalState(installation)).toMatchObject({ operationId: current.operationId, phase: "succeeded", - installedVersion: "fixture-new", + installedVersion: assetVersion, }); }).pipe( Effect.ensuring( @@ -999,66 +944,9 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst }), ); - // A simulated Mac install needs POSIX execute bits, which Windows files lack. - it.effect.skipIf(HostProcess.Platform.defaultValue() === "win32")( - "re-signs the Intel Mac runtime ad hoc and records the signed sizes", - () => - Effect.gen(function* () { - const fs = yield* FileSystem.FileSystem; - const signed: Array> = []; - const spawner = ChildProcessSpawner.make((command) => - Effect.gen(function* () { - if (!ChildProcess.isStandardCommand(command)) - return yield* Effect.die("Unexpected spawn."); - const args = command.args.map(String); - signed.push([String(command.command), ...args]); - // codesign rewrites the signature, which changes each file's size. - for (const file of args.slice(3)) { - yield* fs.writeFileString(file, "signature", { flag: "a" }); - } - return ChildProcessSpawner.makeHandle({ - pid: ChildProcessSpawner.ProcessId(900_000_301), - exitCode: Effect.succeed(ChildProcessSpawner.ExitCode(0)), - isRunning: Effect.succeed(false), - kill: () => Effect.void, - unref: Effect.succeed(Effect.void), - stdin: Sink.drain, - stdout: Stream.empty, - stderr: Stream.empty, - all: Stream.empty, - getInputFd: () => Sink.drain, - getOutputFd: () => Stream.empty, - }); - }).pipe(Effect.orDie), - ); - const { installation, validations } = yield* makeHarness({ - platform: "darwin", - arch: "x64", - spawner, - }); - yield* installation.start; - expect((yield* terminalState(installation)).phase).toBe("succeeded"); - const validated = validations[0]?.executable; - expect(signed).toEqual([ - [ - "/usr/bin/codesign", - "--force", - "--sign", - "-", - validated?.executablePath, - validated?.harnessPath, - ], - ]); - const selected = yield* installation.resolve(); - expect(yield* fs.readFileString(selected.executablePath)).toBe( - `${serverContents}signature`, - ); - }), - ); - // The mocked Linux PATH walk needs POSIX paths; Windows temp paths contain colons. it.effect.skipIf(HostProcess.Platform.defaultValue() === "win32")( - "accepts the agy CLI without a harness sibling but still requires one for other binaries", + "accepts only the agy CLI as a custom or PATH executable", () => Effect.gen(function* () { const fs = yield* FileSystem.FileSystem; @@ -1081,21 +969,17 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst expect(yield* installation.resolve(cli)).toMatchObject({ executablePath: cli, - harnessPath: null, source: "override", version: null, }); expect(yield* installation.resolve(alias)).toMatchObject({ executablePath: alias, - harnessPath: null, }); expect(yield* installation.resolve("agy", { PATH: cliDirectory })).toMatchObject({ executablePath: alias, - harnessPath: null, }); expect(yield* installation.resolve(undefined, { PATH: cliDirectory })).toMatchObject({ executablePath: alias, - harnessPath: null, source: "path", }); expect(yield* installation.resolve(other).pipe(Effect.flip)).toMatchObject({ @@ -1110,7 +994,6 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst yield* fs.symlink(mise, path.join(shims, "agy")); expect(yield* installation.resolve("agy", { PATH: shims })).toMatchObject({ executablePath: path.join(shims, "agy"), - harnessPath: null, }); const { installation: windows } = yield* makeHarness({ baseDir, platform: "win32" }); @@ -1119,7 +1002,6 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst yield* fs.makeDirectory(windowsDirectory); yield* fs.writeFileString(path.join(windowsDirectory, name), "cli"); const selected = yield* windows.resolve("agy", { PATH: `"${windowsDirectory}"` }); - expect(selected.harnessPath).toBeNull(); expect((yield* fs.realPath(selected.executablePath)).toLowerCase()).toBe( (yield* fs.realPath(path.join(windowsDirectory, name))).toLowerCase(), ); @@ -1138,11 +1020,9 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst .makeTempDirectoryScoped({ prefix: "t3-agy-path-test-" }) .pipe(Effect.flatMap((directory) => fs.realPath(directory))); const externalDirectory = path.join(baseDir, "external"); - const externalExecutable = path.join(externalDirectory, executableName); - const externalHarness = path.join(externalDirectory, harnessName); + const externalExecutable = path.join(externalDirectory, "agy"); yield* fs.makeDirectory(externalDirectory); - yield* fs.writeFileString(externalExecutable, "external server", { mode: 0o755 }); - yield* fs.writeFileString(externalHarness, "external harness", { mode: 0o755 }); + yield* fs.writeFileString(externalExecutable, "external cli", { mode: 0o755 }); const { installation } = yield* makeHarness({ baseDir, path: externalDirectory, @@ -1158,25 +1038,18 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst source: "override", managedVersionDirectory: null, }); - expect(yield* installation.resolve(executableName)).toMatchObject({ - source: "override", - }); + expect(yield* installation.resolve("agy")).toMatchObject({ source: "override" }); expect( yield* installation - .resolve(`~/external/${executableName}`) + .resolve("~/external/agy") .pipe(Effect.provideService(HostProcess.HomeDirectory, baseDir)), ).toMatchObject({ source: "override", executablePath: externalExecutable }); - yield* fs.remove(externalHarness); - expect(yield* installation.resolve(externalExecutable).pipe(Effect.flip)).toMatchObject({ - operation: "resolve", - }); expect( yield* installation.resolve(path.join(baseDir, "missing")).pipe(Effect.flip), ).toMatchObject({ operation: "resolve", }); yield* expectPreviousRelease(installation); - yield* fs.writeFileString(externalHarness, "external harness", { mode: 0o755 }); yield* installation.remove(); expect(yield* installation.resolve()).toMatchObject({ source: "path", @@ -1193,23 +1066,8 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst executablePath: externalExecutable, }); expect( - yield* isolated.installation.resolve(executableName, { PATH: externalDirectory }), + yield* isolated.installation.resolve("agy", { PATH: externalDirectory }), ).toMatchObject({ source: "override", executablePath: externalExecutable }); - - const incompleteDirectory = path.join(baseDir, "incomplete"); - yield* fs.makeDirectory(incompleteDirectory); - yield* fs.writeFileString(path.join(incompleteDirectory, executableName), "no harness", { - mode: 0o755, - }); - const shadowedPath = { PATH: `${incompleteDirectory}:${externalDirectory}` }; - expect(yield* isolated.installation.resolve(undefined, shadowedPath)).toMatchObject({ - source: "path", - executablePath: externalExecutable, - }); - expect(yield* isolated.installation.resolve(executableName, shadowedPath)).toMatchObject({ - source: "override", - executablePath: externalExecutable, - }); }), ); @@ -1256,13 +1114,10 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst Effect.gen(function* () { const { installation, baseDir, fs, path } = yield* makeHarness({ previous: true }); const previous = yield* installation.resolve(); - yield* fs.remove(previous.harnessPath!); + yield* fs.remove(previous.executablePath); const externalDirectory = path.join(baseDir, "external"); yield* fs.makeDirectory(externalDirectory); - yield* fs.writeFileString(path.join(externalDirectory, executableName), "external server", { - mode: 0o755, - }); - yield* fs.writeFileString(path.join(externalDirectory, harnessName), "external harness", { + yield* fs.writeFileString(path.join(externalDirectory, "agy"), "external cli", { mode: 0o755, }); const restarted = yield* makeHarness({ baseDir, path: externalDirectory }); @@ -1283,7 +1138,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst yield* restarted.installation.start; expect(yield* terminalState(restarted.installation)).toMatchObject({ phase: "succeeded", - installedVersion: "fixture-new", + installedVersion: assetVersion, canRemove: true, }); yield* Deferred.await(restarted.stagingReleased); @@ -1301,11 +1156,9 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst const profileDirectory = path.join(baseDir, "providers", "antigravity", "profile"); yield* fs.makeDirectory(externalDirectory); yield* fs.makeDirectory(profileDirectory, { recursive: true }); - const externalExecutable = path.join(externalDirectory, executableName); - const externalHarness = path.join(externalDirectory, harnessName); + const externalExecutable = path.join(externalDirectory, "agy"); const profilePath = path.join(profileDirectory, "preferences.json"); - yield* fs.writeFileString(externalExecutable, "external server", { mode: 0o755 }); - yield* fs.writeFileString(externalHarness, "external harness", { mode: 0o755 }); + yield* fs.writeFileString(externalExecutable, "external cli", { mode: 0o755 }); yield* fs.writeFileString(profilePath, "{}"); expect( yield* installation.remove([managed.executablePath]).pipe(Effect.flip), @@ -1319,8 +1172,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst operationId: null, installedVersion: null, }); - expect(yield* fs.readFileString(externalExecutable)).toBe("external server"); - expect(yield* fs.readFileString(externalHarness)).toBe("external harness"); + expect(yield* fs.readFileString(externalExecutable)).toBe("external cli"); expect(yield* fs.readFileString(profilePath)).toBe("{}"); }), ); @@ -1331,7 +1183,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst Effect.gen(function* () { const fs = yield* FileSystem.FileSystem; const path = yield* Path.Path; - const archive = Buffer.from(zipFixtures.windows, "base64"); + const archive = Buffer.from(serverContents); const asset = yield* releaseAsset(archive, "win32"); let denyPointerRename = true; const renameTargets: string[] = []; @@ -1357,7 +1209,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst }, }), }); - yield* writeRelease(installation.managedDirectory, asset, false); + yield* writeRelease(installation.managedDirectory, assetRelease(asset), false); yield* installation.start; expect((yield* terminalState(installation)).phase).toBe("failed"); yield* expectPreviousRelease(installation); @@ -1366,7 +1218,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst denyPointerRename = false; yield* installation.start; expect((yield* terminalState(installation)).phase).toBe("succeeded"); - expect((yield* installation.resolve()).version).toBe("fixture-new"); + expect((yield* installation.resolve()).version).toBe(assetVersion); expect(requests).toEqual([]); expect(validations).toHaveLength(2); expect(renameTargets).toEqual([ diff --git a/apps/server/src/provider/AntigravityInstallation.ts b/apps/server/src/provider/AntigravityInstallation.ts index 0e5c0fcd8a96e..712c76d1c09bf 100644 --- a/apps/server/src/provider/AntigravityInstallation.ts +++ b/apps/server/src/provider/AntigravityInstallation.ts @@ -4,7 +4,6 @@ import * as ModelManifest from "./ModelManifest.ts"; import { resolveProviderCompatibility } from "./providerCompatibility.ts"; import { cliArchiveTarCommand } from "@t3tools/shared/cliRelease"; import { compareSemverVersions } from "@t3tools/shared/semver"; -import * as EffectNodeStream from "@effect/platform-node/NodeStream"; import { ProviderDriverKind, type ProviderInstallState, @@ -45,13 +44,11 @@ import { parseAntigravityCliRelease, type AntigravityCliReleaseAsset, } from "./antigravityCliRelease.ts"; -import { openZipArchive } from "../zipArchive.ts"; import { makeAntigravityAcpRuntime } from "./acp/AntigravityAcpSupport.ts"; import { buildAntigravityAcpSpawnInput, prepareAntigravityProfile, } from "./antigravityAuthSupport.ts"; -import { type AntigravityReleaseAsset } from "./antigravityRelease.ts"; const DRIVER = ProviderDriverKind.make("antigravity"); const DOWNLOAD_TIMEOUT = "45 minutes"; @@ -71,7 +68,6 @@ const InstalledRelease = Schema.Struct({ releaseId: ReleaseId, version: Schema.String, executable: Schema.Struct({ name: Schema.String, bytes: Schema.Number }), - harness: Schema.NullOr(Schema.Struct({ name: Schema.String, bytes: Schema.Number })), }); type InstalledRelease = typeof InstalledRelease.Type; const encodeActiveRelease = Schema.encodeEffect(Schema.fromJsonString(ActiveRelease)); @@ -94,8 +90,6 @@ const isAcpProcessExitedError = Schema.is(EffectAcpErrors.AcpProcessExitedError) export interface AntigravityExecutable { readonly executablePath: string; - /** Null for the `agy` CLI, which embeds the harness and runs as `agy acp`. */ - readonly harnessPath: string | null; readonly source: "override" | "managed" | "path"; readonly version: string | null; readonly managedVersionDirectory: string | null; @@ -149,7 +143,7 @@ export class AntigravityInstallation extends Context.Service< export interface AntigravityInstallationOptions { readonly baseDir: string; - readonly releaseAsset?: AntigravityReleaseAsset | AntigravityCliReleaseAsset | null; + readonly releaseAsset?: AntigravityCliReleaseAsset | null; readonly updateChecksEnabled?: Effect.Effect; readonly validate?: ( executable: AntigravityExecutable, @@ -167,13 +161,6 @@ const installationError = (operation: string, detail: string, cause?: unknown) = const wrapFailure = (operation: string, detail: string) => (cause: unknown) => isInstallationError(cause) ? cause : installationError(operation, detail, cause); -function executableNames(platform: NodeJS.Platform) { - return platform === "win32" - ? { executable: "agy_acp_server.exe", harness: "localharness_external.exe" } - : { executable: "agy_acp_server.par", harness: "localharness_external" }; -} - -/** Antigravity CLI 1.5.0+ serves ACP itself (`agy acp`), so it has no `localharness_external` sibling. */ function isAntigravityCli(...candidates: ReadonlyArray) { return candidates.some((candidate) => /^(?:agy|antigravity)(?:\.(?:exe|cmd|bat))?$/iu.test(candidate.split(/[\\/]/u).at(-1) ?? ""), @@ -204,7 +191,7 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma options.releaseAsset === undefined ? antigravityCliTarget(platform, arch) !== null : options.releaseAsset !== null; - const names = executableNames(platform); + const cliExecutableName = platform === "win32" ? "agy.exe" : "antigravity"; const managedDirectory = path.join( options.baseDir, "tools", @@ -221,8 +208,7 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma operationId: null, phase: "idle", downloadedBytes: 0, - totalBytes: - releaseAsset !== null && "archiveBytes" in releaseAsset ? releaseAsset.archiveBytes : null, + totalBytes: null, version: releaseAsset?.version ?? null, installedVersion: null, canRemove: false, @@ -289,22 +275,21 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma ) { const directory = path.join(versionsDirectory, releaseId); const record = yield* readRecord(path.join(directory, RELEASE_RECORD), InstalledRelease); + if (record.releaseId === releaseId && record.executable.name !== cliExecutableName) { + return yield* installationError( + "resolve", + "This managed Antigravity runtime predates the Antigravity CLI and no longer works. Update it in Antigravity setup.", + ); + } if ( record.releaseId !== releaseId || - (record.harness === null - ? record.executable.name !== (platform === "win32" ? "agy.exe" : "antigravity") - : record.executable.name !== names.executable || record.harness.name !== names.harness) || !Number.isSafeInteger(record.executable.bytes) || record.executable.bytes <= 0 || - (record.harness !== null && - (!Number.isSafeInteger(record.harness.bytes) || record.harness.bytes <= 0)) || !record.version.trim() || !(yield* executableFile( path.join(directory, record.executable.name), record.executable.bytes, - )) || - (record.harness !== null && - !(yield* executableFile(path.join(directory, record.harness.name), record.harness.bytes))) + )) ) { return yield* installationError( "resolve", @@ -313,7 +298,6 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma } return { executablePath: path.join(directory, record.executable.name), - harnessPath: record.harness === null ? null : path.join(directory, record.harness.name), source: "managed", version: record.version, managedVersionDirectory: directory, @@ -337,20 +321,9 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma return { ...installed, source }; } // Keep launcher symlinks intact: version-manager shims dispatch by their invoked name. - if (isAntigravityCli(candidate, executablePath)) { - return { - executablePath: candidate, - harnessPath: null, - source, - version: null, - managedVersionDirectory: null, - } satisfies AntigravityExecutable; - } - const harnessPath = path.join(directory, names.harness); - if (!(yield* executableFile(harnessPath))) return null; + if (!isAntigravityCli(candidate, executablePath)) return null; return { - executablePath, - harnessPath, + executablePath: candidate, source, version: null, managedVersionDirectory: null, @@ -365,7 +338,7 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma Effect.provideService(Path.Path, path), ); - // Resolve per PATH entry so an executable without its harness falls through to later entries. + // Resolve per PATH entry so a candidate that is not the CLI falls through to later entries. const commandCandidates = Effect.fn("AntigravityInstallation.commandCandidates")(function* ( command: string, processEnvironment = environment, @@ -399,7 +372,7 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma } return yield* installationError( "resolve", - "The custom Antigravity executable is missing or not executable, or it needs a localharness_external sibling. The agy CLI does not.", + "The custom Antigravity executable is missing or not executable, or it is not the agy CLI.", ); } if (yield* fs.exists(activePath)) { @@ -412,11 +385,9 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma ); return installed; } - for (const command of [names.executable, "agy"]) { - for (const candidate of yield* commandCandidates(command, processEnvironment)) { - const selected = yield* fromExternal(candidate, "path"); - if (selected) return selected; - } + for (const candidate of yield* commandCandidates("agy", processEnvironment)) { + const selected = yield* fromExternal(candidate, "path"); + if (selected) return selected; } return yield* installationError( "resolve", @@ -519,11 +490,8 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma }); const initialized = yield* runtime.initialize(); if ( - (executable.harnessPath === null - ? initialized.agentInfo?.name !== "Antigravity ACP Server" - : initialized.agentInfo?.name !== "antigravity-acp") || + initialized.agentInfo?.name !== "Antigravity ACP Server" || initialized.agentInfo?.version !== expectedVersion || - // Antigravity 1.1.1 may report protocol 2 with legacy ACP; choose wire format from the response shape. (initialized.protocolVersion !== 1 && initialized.protocolVersion !== 2) || initialized.agentCapabilities?.loadSession !== true || !initialized.agentCapabilities.sessionCapabilities?.resume || @@ -569,12 +537,10 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma ); const install = Effect.fn("AntigravityInstallation.install")( - function* (asset: AntigravityReleaseAsset | AntigravityCliReleaseAsset) { + function* (asset: AntigravityCliReleaseAsset) { yield* ensureEligible(asset.version); - const cli = "sha512" in asset; - // Existing installation records use 64-character IDs, including native SHA-512 prefixes. - const releaseId = cli ? asset.sha512.slice(0, 64) : asset.sha256; - const archiveBytes = cli ? null : asset.archiveBytes; + // Release IDs are 64 hex characters, so a release is named by its SHA-512's prefix. + const releaseId = asset.sha512.slice(0, 64); yield* resolveNodeExecutable("Antigravity", environment).pipe( Effect.provideService(FileSystem.FileSystem, fs), Effect.provideService(Path.Path, path), @@ -583,18 +549,6 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma installationError("verify", nodeRuntimeUnavailableMessage("Antigravity"), cause), ), ); - if (!cli && platform === "linux" && arch === "arm64") { - const pageSize = yield* spawner - .string(ChildProcess.make("getconf", ["PAGESIZE"], { stdin: "ignore", stderr: "ignore" })) - .pipe( - Effect.map((output) => Number(output.trim())), - Effect.timeout("5 seconds"), - Effect.orElseSucceed(() => Number.NaN), - ); - if (pageSize > 4096) { - return yield* installationError("download", LARGE_PAGE_KERNEL_MESSAGE); - } - } const report = (phase: ProviderInstallState["phase"], message: string | null) => SubscriptionRef.update(state, (current) => ({ ...current, phase, message })); yield* fs.makeDirectory(versionsDirectory, { recursive: true }); @@ -653,9 +607,7 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma try: () => NodeFSP.statfs(versionsDirectory, { bigint: true }), catch: (cause) => installationError("download", "Could not check free disk space.", cause), }).pipe(Effect.option); - const required = cli - ? MAX_DOWNLOAD_BYTES + MAX_EXECUTABLE_BYTES + FREE_SPACE_MARGIN - : asset.archiveBytes + asset.executable.bytes + asset.harness.bytes + FREE_SPACE_MARGIN; + const required = MAX_DOWNLOAD_BYTES + MAX_EXECUTABLE_BYTES + FREE_SPACE_MARGIN; if ( Option.isSome(available) && available.value.bavail * available.value.bsize < BigInt(required) @@ -669,36 +621,21 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma directory: versionsDirectory, prefix: ".install-", }); - const archivePath = path.join(staging, "download.zip"); + const archivePath = path.join(staging, "download"); const pairDirectory = path.join(staging, "runtime"); yield* fs.makeDirectory(pairDirectory); - const hash = NodeCrypto.createHash(cli ? "sha512" : "sha256"); + const hash = NodeCrypto.createHash("sha512"); let downloadedBytes = 0; let lastProgressAt = yield* Clock.currentTimeMillis; yield* Effect.gen(function* () { const response = yield* http .execute(HttpClientRequest.get(asset.url)) .pipe(Effect.flatMap(HttpClientResponse.filterStatusOk)); - // dl.google.com may gzip the zip: content-length is encoded, while byte/hash checks use decoded data. - const contentLength = response.headers["content-length"]; - const contentEncoding = response.headers["content-encoding"]?.trim().toLowerCase(); - const identityBody = contentEncoding === undefined || contentEncoding === "identity"; - if ( - identityBody && - contentLength !== undefined && - archiveBytes !== null && - Number(contentLength) !== archiveBytes - ) { - return yield* installationError( - "download", - "The Antigravity download size did not match the pinned release.", - ); - } yield* response.stream.pipe( Stream.tap((chunk) => Effect.gen(function* () { downloadedBytes += chunk.byteLength; - if (downloadedBytes > (archiveBytes ?? MAX_DOWNLOAD_BYTES)) { + if (downloadedBytes > MAX_DOWNLOAD_BYTES) { return yield* installationError( "download", "The Antigravity download exceeded its allowed size.", @@ -706,7 +643,7 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma } hash.update(chunk); const now = yield* Clock.currentTimeMillis; - if (now - lastProgressAt >= 250 || downloadedBytes === archiveBytes) { + if (now - lastProgressAt >= 250) { lastProgressAt = now; yield* SubscriptionRef.update(state, (current) => ({ ...current, @@ -729,10 +666,7 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma : cause, ), ); - if ( - (archiveBytes !== null && downloadedBytes !== archiveBytes) || - hash.digest("hex") !== (cli ? asset.sha512 : asset.sha256) - ) { + if (hash.digest("hex") !== asset.sha512) { return yield* installationError( "download", "The Antigravity download failed its size or checksum check. Nothing was installed.", @@ -740,162 +674,57 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma } yield* report("extracting", "Extracting the verified runtime."); - if (cli) { - const executablePath = path.join(pairDirectory, asset.executable.name); - if (asset.format === "executable") { - yield* fs.copyFile(archivePath, executablePath); - } else { - const tar = cliArchiveTarCommand(platform, environment); - const list = yield* spawner.string(ChildProcess.make(tar, ["-tzf", archivePath])); - const types = yield* spawner.string(ChildProcess.make(tar, ["-tvzf", archivePath])); - if ( - list.trim() !== asset.executable.name || - types.trim().split(/\r?\n/u).length !== 1 || - !types.startsWith("-") - ) { - return yield* installationError( - "extract", - "The Antigravity archive must contain one regular executable.", - ); - } - yield* Effect.gen(function* () { - const child = yield* spawner.spawn( - ChildProcess.make(tar, ["-xOzf", archivePath, asset.executable.name], { - stdout: "pipe", - stderr: "pipe", - }), - ); - let extractedBytes = 0; - yield* child.stdout.pipe( - Stream.tap((chunk) => - Effect.gen(function* () { - extractedBytes += chunk.byteLength; - if (extractedBytes > MAX_EXECUTABLE_BYTES) - return yield* installationError( - "extract", - "The Antigravity executable exceeded its size limit.", - ); - }), - ), - Stream.run(fs.sink(executablePath, { flag: "wx", mode: 0o700 })), - ); - if ((yield* child.exitCode) !== 0 || extractedBytes === 0) - return yield* installationError( - "extract", - "Could not extract the Antigravity executable.", - ); - }).pipe(Effect.scoped); + const executablePath = path.join(pairDirectory, asset.executable.name); + if (asset.format === "executable") { + yield* fs.copyFile(archivePath, executablePath); + } else { + const tar = cliArchiveTarCommand(platform, environment); + const list = yield* spawner.string(ChildProcess.make(tar, ["-tzf", archivePath])); + const types = yield* spawner.string(ChildProcess.make(tar, ["-tvzf", archivePath])); + if ( + list.trim() !== asset.executable.name || + types.trim().split(/\r?\n/u).length !== 1 || + !types.startsWith("-") + ) { + return yield* installationError( + "extract", + "The Antigravity archive must contain one regular executable.", + ); } - } else yield* Effect.gen(function* () { - const archive = yield* openZipArchive(archivePath, (detail, cause) => - installationError("extract", detail, cause), + const child = yield* spawner.spawn( + ChildProcess.make(tar, ["-xOzf", archivePath, asset.executable.name], { + stdout: "pipe", + stderr: "pipe", + }), ); - if (archive.entryCount !== 2) { - return yield* installationError( - "extract", - "The archive must contain exactly the Antigravity executable and its harness.", - ); - } - const seen = new Set(); - for (;;) { - const entry = yield* archive.next; - if (!entry) break; - const expected = [asset.executable, asset.harness].find( - (file) => file.name === entry.fileName, - ); - const unixType = (entry.externalFileAttributes >>> 16) & 0o170000; - if ( - !expected || - seen.has(entry.fileName) || - entry.fileName.includes("/") || - entry.fileName.includes("\\") || - (unixType !== 0 && unixType !== 0o100000) || - (entry.externalFileAttributes & 0x10) !== 0 || - (entry.generalPurposeBitFlag & 1) !== 0 || - ![0, 8].includes(entry.compressionMethod) || - entry.uncompressedSize !== expected.bytes - ) { - return yield* installationError( - "extract", - "The archive contains an unexpected, unsafe, or incorrectly sized member.", - ); - } - seen.add(entry.fileName); - yield* Effect.gen(function* () { - const readable = yield* archive.streamEntry(entry); - let extractedBytes = 0; - yield* EffectNodeStream.fromReadable({ - evaluate: () => readable, - onError: wrapFailure("extract", "Could not extract the Antigravity runtime."), - }).pipe( - Stream.tap((chunk) => - Effect.gen(function* () { - extractedBytes += chunk.byteLength; - if (extractedBytes > expected.bytes) { - return yield* installationError( - "extract", - "An archive member exceeded its pinned size.", - ); - } - }), - ), - Stream.run( - fs.sink(path.join(pairDirectory, entry.fileName), { flag: "wx", mode: 0o700 }), - ), - ); - if (extractedBytes !== expected.bytes) { - return yield* installationError("extract", "An archive member was truncated."); - } - }).pipe(Effect.scoped); - } - if (!seen.has(asset.executable.name) || !seen.has(asset.harness.name)) { + let extractedBytes = 0; + yield* child.stdout.pipe( + Stream.tap((chunk) => + Effect.gen(function* () { + extractedBytes += chunk.byteLength; + if (extractedBytes > MAX_EXECUTABLE_BYTES) + return yield* installationError( + "extract", + "The Antigravity executable exceeded its size limit.", + ); + }), + ), + Stream.run(fs.sink(executablePath, { flag: "wx", mode: 0o700 })), + ); + if ((yield* child.exitCode) !== 0 || extractedBytes === 0) return yield* installationError( "extract", - "The archive is missing the Antigravity executable or its harness.", + "Could not extract the Antigravity executable.", ); - } }).pipe(Effect.scoped); - yield* fs.remove(archivePath); - const executablePath = path.join(pairDirectory, asset.executable.name); - const harnessPath = cli ? null : path.join(pairDirectory, asset.harness.name); - if (platform !== "win32") { - yield* fs.chmod(executablePath, 0o755); - if (harnessPath !== null) yield* fs.chmod(harnessPath, 0o755); - } - if (!cli && platform === "darwin" && arch === "x64") { - // Google signs the Intel build with the hardened runtime but no JIT entitlement, so - // libffi's writable+executable trampolines spin forever. Re-sign ad hoc after the hash check. - const exitCode = yield* spawner - .spawn( - ChildProcess.make( - "/usr/bin/codesign", - [ - "--force", - "--sign", - "-", - executablePath, - ...(harnessPath === null ? [] : [harnessPath]), - ], - { stdout: "ignore", stderr: "ignore" }, - ), - ) - .pipe( - Effect.flatMap((child) => child.exitCode), - Effect.scoped, - ); - if (exitCode !== 0) { - return yield* installationError( - "extract", - "Could not prepare the Antigravity runtime for this Mac. Check that codesign is available.", - ); - } } + yield* fs.remove(archivePath); + if (platform !== "win32") yield* fs.chmod(executablePath, 0o755); yield* report("verifying", "Checking the downloaded runtime."); yield* validate( { executablePath, - harnessPath, source: "managed", version: asset.version, managedVersionDirectory: pairDirectory, @@ -909,10 +738,6 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma name: asset.executable.name, bytes: Number((yield* fs.stat(executablePath)).size), }, - harness: - cli || harnessPath === null - ? null - : { name: asset.harness.name, bytes: Number((yield* fs.stat(harnessPath)).size) }, }; yield* fs.writeFileString( path.join(pairDirectory, RELEASE_RECORD), @@ -1023,7 +848,6 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma const reuse = Option.isSome(installed) && installed.value.source === "managed" && - installed.value.harnessPath === null && (asset === null || compareSemverVersions(installed.value.version!, asset.version) > 0) ? installed.value : undefined; @@ -1038,7 +862,7 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma operationId, phase: reuse === undefined ? "downloading" : "verifying", downloadedBytes: 0, - totalBytes: asset !== null && "archiveBytes" in asset ? asset.archiveBytes : null, + totalBytes: null, version: reuse?.version ?? asset?.version ?? null, installedVersion: current.installedVersion, canRemove: current.canRemove, diff --git a/apps/server/src/provider/AntigravityProvider.test.ts b/apps/server/src/provider/AntigravityProvider.test.ts index 9612fb535ddd9..cf91cbb020a06 100644 --- a/apps/server/src/provider/AntigravityProvider.test.ts +++ b/apps/server/src/provider/AntigravityProvider.test.ts @@ -46,7 +46,7 @@ const initializeResult = { agentInfo: { name: "antigravity-acp", title: "Google Antigravity", - version: "agy_acp_server_20260818_01_RC01", + version: "1.5.12", }, } satisfies EffectAcpSchema.InitializeResponse; @@ -331,7 +331,7 @@ it.layer(layerTest)("Antigravity provider snapshots", (it) => { expect(snapshot).toMatchObject({ installed: true, status: "warning", - version: "agy_acp_server_20260818_01_RC01", + version: "1.5.12", auth: { status: "unknown", ...(auth ? { type: auth.type } : {}) }, message: auth?.type === "gemini-api-key" || auth?.type === "agent-platform" @@ -475,7 +475,7 @@ it.layer(layerTest)("Antigravity provider snapshots", (it) => { ...started, initializeResult: { ...initializeResult, - agentInfo: { ...initializeResult.agentInfo, version: "1.4.0" }, + agentInfo: { ...initializeResult.agentInfo, version: "1.5.13" }, }, }); yield* Ref.set( @@ -485,7 +485,7 @@ it.layer(layerTest)("Antigravity provider snapshots", (it) => { agentInfo: { ...initializeResult.agentInfo, version: "unknown" }, }), ); - expect((yield* harness.provider.snapshot.refresh).version).toBe("1.4.0"); + expect((yield* harness.provider.snapshot.refresh).version).toBe("1.5.13"); }), ); diff --git a/apps/server/src/provider/Drivers/AntigravityDriver.test.ts b/apps/server/src/provider/Drivers/AntigravityDriver.test.ts index 61dfcf62c7f5a..2adb02b6a6b44 100644 --- a/apps/server/src/provider/Drivers/AntigravityDriver.test.ts +++ b/apps/server/src/provider/Drivers/AntigravityDriver.test.ts @@ -84,6 +84,7 @@ const makeHarness = Effect.fn("makeAntigravityDriverHarness")(function* ( const profileDirectory = directories.profile; const instancePath = `${path.join(root, "instance-bin")}:${baseEnv.PATH ?? ""}`; + const agentExecutables = new Set(); const makeExecutable = Effect.fn("AntigravityDriverTest.makeExecutable")(function* ( name: string, options: { @@ -95,8 +96,7 @@ const makeHarness = Effect.fn("makeAntigravityDriverHarness")(function* ( } = {}, ) { const directory = path.join(root, name); - const executablePath = path.join(directory, "agy_acp_server.par"); - const harnessPath = path.join(directory, "localharness_external"); + const executablePath = path.join(directory, "agy"); yield* fs.makeDirectory(directory, { recursive: true }); const authorizationUrl = "https://accounts.google.com/o/oauth2/v2/auth?response_type=code&redirect_uri=http%3A%2F%2F127.0.0.1%3A51234%2F&state=fixture-state"; @@ -120,12 +120,10 @@ const makeHarness = Effect.fn("makeAntigravityDriverHarness")(function* ( "", ].join("\n"), ); - yield* fs.writeFileString(harnessPath, "#!/bin/sh\nexit 99\n"); yield* fs.chmod(executablePath, 0o755); - yield* fs.chmod(harnessPath, 0o755); + agentExecutables.add(executablePath); return { executablePath, - harnessPath, source: "managed", version: name, managedVersionDirectory: directory, @@ -149,7 +147,6 @@ const makeHarness = Effect.fn("makeAntigravityDriverHarness")(function* ( extendEnv: boolean | undefined; environment: Record; profileDirectory: string | undefined; - harnessPath: string | undefined; forceFileStorage: string | undefined; credentialKeys: ReadonlyArray; geminiApiKey: string | undefined; @@ -213,14 +210,12 @@ const makeHarness = Effect.fn("makeAntigravityDriverHarness")(function* ( extendEnv: command.options.extendEnv, environment: Object.fromEntries(Object.keys(environment).map((name) => [name, env(name)])), profileDirectory: env("GEMINI_HOME"), - harnessPath: env("ANTIGRAVITY_HARNESS_PATH"), forceFileStorage: env("AGY_ACP_FORCE_FILE_STORAGE"), credentialKeys: Object.keys(environment).filter((key) => blockedCredentialKeys.has(key.toUpperCase()), ), geminiApiKey: env("GEMINI_API_KEY"), - tempDirectory: - environment.ANTIGRAVITY_HARNESS_PATH === undefined ? undefined : env("TMPDIR"), + tempDirectory: agentExecutables.has(command.command) ? env("TMPDIR") : undefined, handle, }); return handle; @@ -342,17 +337,19 @@ it.layer(layerTest)("AntigravityDriver", (it) => { { binaryPath: "", path: h.instancePath }, { binaryPath: "", path: h.instancePath }, ]); - const nativeLaunches = h.launches.filter((launch) => launch.harnessPath !== undefined); - expect(nativeLaunches.map((launch) => launch.command)).toEqual([ + const agentLaunches = h.launches.filter((launch) => launch.tempDirectory !== undefined); + expect(agentLaunches.map((launch) => launch.command)).toEqual([ h.first.executablePath, h.second.executablePath, ]); - expect(nativeLaunches.map((launch) => launch.harnessPath)).toEqual([ - h.first.harnessPath, - h.second.harnessPath, - ]); - for (const launch of nativeLaunches) { - expect(launch.args).toEqual(hostPlatform === "linux" ? ["--uid="] : []); + for (const launch of agentLaunches) { + expect(launch.args).toEqual([ + "acp", + "--gemini-dir", + h.profileDirectory, + "--app-data-dir", + "antigravity-acp", + ]); expect(launch.profileDirectory).toBe(h.profileDirectory); expect(launch.forceFileStorage).toBe("1"); expect(launch.extendEnv).toBe(false); @@ -425,10 +422,7 @@ it.layer(layerTest)("AntigravityDriver", (it) => { ]); // The agy CLI rejects `yolo` and `auto_edit`; it stays in `default` and T3 answers its requests. - h.controls.selected = { - ...(yield* h.makeExecutable("runtime cli", { initialMode: "auto_edit" })), - harnessPath: null, - }; + h.controls.selected = yield* h.makeExecutable("runtime cli", { initialMode: "auto_edit" }); for (const runtimeMode of ["full-access", "auto-accept-edits"] as const) { const requestsBefore = (yield* h.readRequests).length; const cliThreadId = ThreadId.make(`thread-antigravity-cli-${runtimeMode}`); diff --git a/apps/server/src/provider/Drivers/AntigravityDriver.ts b/apps/server/src/provider/Drivers/AntigravityDriver.ts index 0efd595192038..0e19a72924351 100644 --- a/apps/server/src/provider/Drivers/AntigravityDriver.ts +++ b/apps/server/src/provider/Drivers/AntigravityDriver.ts @@ -313,9 +313,7 @@ export const AntigravityDriver: ProviderDriver< }); return { ...runtime, - ...(executable.harnessPath === null - ? { setMode: (modeId: string) => runtime.setMode(antigravityCliSessionMode(modeId)) } - : {}), + setMode: (modeId: string) => runtime.setMode(antigravityCliSessionMode(modeId)), start: () => startCompatible().pipe( Effect.tapError((cause): Effect.Effect => diff --git a/apps/server/src/provider/ProviderRegistry.test.ts b/apps/server/src/provider/ProviderRegistry.test.ts index dcbadc9d49aaa..747b742cd5cc7 100644 --- a/apps/server/src/provider/ProviderRegistry.test.ts +++ b/apps/server/src/provider/ProviderRegistry.test.ts @@ -2042,7 +2042,7 @@ it.layer( installed: true, auth: { status: "authenticated", type: "oauth-personal", label: "Google account" }, checkedAt: "2026-09-05T00:00:00.000Z", - version: "agy_acp_server_1.1.1", + version: "1.5.12", models: [ { slug: "gemini-3.7-flash-high", diff --git a/apps/server/src/provider/acp/AntigravityAcpSupport.test.ts b/apps/server/src/provider/acp/AntigravityAcpSupport.test.ts index dc755d1e7a5a4..c289043dd4a39 100644 --- a/apps/server/src/provider/acp/AntigravityAcpSupport.test.ts +++ b/apps/server/src/provider/acp/AntigravityAcpSupport.test.ts @@ -5,7 +5,6 @@ import { PROVIDER_SEND_TURN_MAX_IMAGE_BYTES, type ChatAttachment, } from "@t3tools/contracts"; -import * as HostProcess from "@t3tools/shared/HostProcess"; import * as Effect from "effect/Effect"; import * as FileSystem from "effect/FileSystem"; import * as Path from "effect/Path"; @@ -19,7 +18,6 @@ import { antigravityClientInfo, antigravitySessionMeta, buildAntigravityPrompt, - isQualifiedAntigravityRelease, } from "./AntigravityAcpSupport.ts"; const modelConfig = { @@ -60,41 +58,30 @@ function makeModelRuntime( describe("Antigravity release gates", () => { it.each([ - { version: "1.4.1", filter: false, native: false, ownName: false, advertisedAppend: false }, - { version: "1.4.2", filter: true, native: false, ownName: false, advertisedAppend: false }, - { version: "1.4.4", filter: true, native: false, ownName: false, advertisedAppend: false }, - { version: "1.4.5", filter: true, native: true, ownName: false, advertisedAppend: false }, - { version: "1.4.6", filter: false, native: false, ownName: false, advertisedAppend: false }, - { version: "1.5.0", filter: false, native: false, ownName: false, advertisedAppend: false }, - { version: "1.5.1", filter: false, native: false, ownName: true, advertisedAppend: false }, - { version: "1.5.7", filter: false, native: false, ownName: true, advertisedAppend: true }, - { version: "1.3.0", filter: false, native: false, ownName: false, advertisedAppend: false }, - { version: undefined, filter: false, native: false, ownName: false, advertisedAppend: false }, - { version: "unknown", filter: false, native: false, ownName: false, advertisedAppend: false }, + { version: "1.5.0", ownName: false, advertisedAppend: false }, + { version: "1.5.1", ownName: true, advertisedAppend: false }, + { version: "1.5.7", ownName: true, advertisedAppend: true }, + { version: undefined, ownName: false, advertisedAppend: false }, + { version: "unknown", ownName: false, advertisedAppend: false }, ])( - "$version: workflow filter $filter, qualified reads $native, advertised system append $advertisedAppend, own client name $ownName", - ({ version, filter, native, ownName, advertisedAppend }) => { + "$version: advertised system append $advertisedAppend, own client name $ownName", + ({ version, ownName, advertisedAppend }) => { const initialize = { protocolVersion: 1, ...(advertisedAppend ? { agentCapabilities: { _meta: { antigravity: { systemPrompt: { append: true } } } } } : {}), - ...(version === undefined ? {} : { agentInfo: { name: "antigravity-acp", version } }), - }; - // Helpers send no append, so only the workflow filter can apply. - expect(antigravitySessionMeta(initialize)).toEqual( - filter ? { antigravity: { disabledTools: ["run_workflow"] } } : undefined, - ); - const antigravity = { - ...(filter ? { disabledTools: ["run_workflow"] } : {}), - ...(native || advertisedAppend - ? { systemPrompt: { append: "" } } - : {}), + ...(version === undefined + ? {} + : { agentInfo: { name: "Antigravity ACP Server", version } }), }; + // Helpers send no append. + expect(antigravitySessionMeta(initialize)).toBeUndefined(); expect(antigravitySessionMeta(initialize, "")).toEqual( - filter || native || advertisedAppend ? { antigravity } : undefined, + advertisedAppend + ? { antigravity: { systemPrompt: { append: "" } } } + : undefined, ); - expect(isQualifiedAntigravityRelease(version)).toBe(native); expect(antigravityClientInfo(version).name).toBe(ownName ? "t3-code" : "zed"); }, ); @@ -380,89 +367,6 @@ it.layer(NodeServices.layer)("buildAntigravityPrompt", (it) => { }), ); - it.effect.each([ - { - case: "a Gemini model id", - model: { id: "gemini-3.8-flash", name: "Gemini 3.8 Flash" }, - linked: true, - }, - { - case: "an opaque id named Gemini", - model: { id: "agy-model", name: "Gemini 4 Carbon" }, - linked: true, - }, - { case: "an unknown model", model: { id: "agy-custom", name: "Custom" }, linked: false }, - { case: "an unlisted opaque id", model: { id: "agy-custom", name: undefined }, linked: false }, - { case: "an unresolved model", model: undefined, linked: false }, - { - case: "a Claude model", - model: { id: "claude-opus-5-5", name: "Claude Opus 5.5" }, - linked: false, - }, - { - case: "an unqualified runtime", - agentVersion: "1.4.1", - model: { id: "gemini-3.8-flash", name: "Gemini 3.8 Flash" }, - linked: false, - }, - { - case: "a Windows host", - platform: "win32" as const, - model: { id: "gemini-3.8-flash", name: "Gemini 3.8 Flash" }, - linked: false, - }, - { - case: "a clip over 20 MiB", - model: { id: "gemini-3.8-flash", name: "Gemini 3.8 Flash" }, - linked: false, - sizeBytes: 20 * 1024 * 1024 + 1, - }, - ])( - "links an MP4 for $case only when supported", - ({ agentVersion = "1.4.5", platform = "linux", model, linked, ...size }) => - Effect.gen(function* () { - const fixture = yield* makeAttachmentFixture(); - const clip = { - ...textAttachment, - id: "clip", - name: "clip.mp4", - mimeType: "video/mp4", - sizeBytes: 6 * 1024 * 1024, - ...size, - }; - const upload = yield* fixture.write(clip, ""); - yield* fixture.fs.truncate(upload.filePath, clip.sizeBytes); - const prompt = yield* buildAntigravityPrompt({ - input: "What colors appear?", - attachments: [clip], - resolveAttachmentPath: fixture.resolve, - promptCapabilities: { image: true, audio: true, embeddedContext: true }, - agentVersion, - currentModel: model, - }).pipe( - Effect.provideService(HostProcess.Platform, platform), - Effect.provideService(FileSystem.FileSystem, { - ...fixture.fs, - stream: () => Effect.die("Linked video is read by the agent").pipe(Stream.fromEffect), - }), - ); - expect(prompt).toEqual([ - { type: "text", text: "What colors appear?" }, - ...(linked - ? [ - { - type: "resource_link", - uri: upload.uri, - name: "clip.mp4", - mimeType: "video/mp4", - size: clip.sizeBytes, - }, - ] - : []), - ]); - }), - ); - it.effect.each([undefined, {}, { image: false, audio: false, embeddedContext: false }])( "keeps attachments path-only when native prompt capabilities are absent: %s", (promptCapabilities) => diff --git a/apps/server/src/provider/acp/AntigravityAcpSupport.ts b/apps/server/src/provider/acp/AntigravityAcpSupport.ts index 7fd64e2534fa7..f5e43daf01051 100644 --- a/apps/server/src/provider/acp/AntigravityAcpSupport.ts +++ b/apps/server/src/provider/acp/AntigravityAcpSupport.ts @@ -6,7 +6,6 @@ import { type ProviderSendTurnInput, type RuntimeMode, } from "@t3tools/contracts"; -import * as HostProcess from "@t3tools/shared/HostProcess"; import * as SecureRandom from "effect/crypto/SecureRandom"; import * as Effect from "effect/Effect"; import * as FileSystem from "effect/FileSystem"; @@ -42,10 +41,10 @@ export interface AntigravityAcpRuntimeInput extends Omit< > { readonly childProcessSpawner: ChildProcessSpawner.ChildProcessSpawner["Service"]; readonly onAuthorizationUrl?: (url: string) => Effect.Effect; - /** Serve `fs/read_text_file` for runtimes whose native reader is not qualified. */ + /** Serve `fs/read_text_file` from T3 instead of the agent's native reader. */ readonly clientFileReads?: boolean; readonly clientCapabilities?: AcpSessionRuntime.AcpSessionRuntimeOptions["clientCapabilities"]; - /** The installed version, known before `initialize`; it picks the file reader and client name. */ + /** The installed version, known before `initialize`; it picks the client name. */ readonly runtimeVersion?: string | null; /** Conversational sessions only; helpers and probes leave the system prompt untouched. */ readonly sessionSystemPromptAppend?: string; @@ -65,38 +64,12 @@ function compareVersions(left: ReadonlyArray, right: ReadonlyArray= 0 && - compareVersions(parsed, [1, 4, 5]) <= 0 - ); -} - -/** - * Releases T3 qualified for native range reads and linked video. On 1.4.5 the client-read path - * sends a whole file to serve one line, and the native reader keeps diff edits. - */ -export function isQualifiedAntigravityRelease(version: string | null | undefined): boolean { - return version?.trim() === "1.4.5"; -} - // `agy acp` 1.5.1 offers every model to every ACP client; older runtimes allowlist editors. const OPEN_MODEL_ACCESS_RELEASE = [1, 5, 1] as const; -/** - * 1.4.5 appends `systemPrompt.append` to its system instructions on new, load and resume, and - * keeps none of it between processes, so every activation sends it again. - */ export const antigravityAppendsSystemPrompt = ( initializeResult: EffectAcpSchema.InitializeResponse, ) => { - if (isQualifiedAntigravityRelease(initializeResult.agentInfo?.version)) return true; const extension = initializeResult.agentCapabilities?._meta?.antigravity; return ( Predicate.isObject(extension) && @@ -109,15 +82,9 @@ export function antigravitySessionMeta( initializeResult: EffectAcpSchema.InitializeResponse, systemPromptAppend?: string, ): EffectAcpSchema.NewSessionRequest["_meta"] | undefined { - const antigravity = { - ...(antigravityWritesRunWorkflowSkill(initializeResult.agentInfo?.version) - ? { disabledTools: ["run_workflow"] } - : {}), - ...(systemPromptAppend !== undefined && antigravityAppendsSystemPrompt(initializeResult) - ? { systemPrompt: { append: systemPromptAppend } } - : {}), - }; - return Object.keys(antigravity).length === 0 ? undefined : { antigravity }; + return systemPromptAppend !== undefined && antigravityAppendsSystemPrompt(initializeResult) + ? { antigravity: { systemPrompt: { append: systemPromptAppend } } } + : undefined; } /** Older releases offer non-Gemini models only to allowlisted clients such as Zed. */ @@ -149,8 +116,7 @@ export const makeAntigravityAcpRuntime = Effect.fn("makeAntigravityAcpRuntime")( ...input.clientCapabilities, // Advertising writes swaps the agent's diff edits for whole-file client_edit_file. fs: { - readTextFile: - input.clientFileReads === true && !isQualifiedAntigravityRelease(input.runtimeVersion), + readTextFile: input.clientFileReads === true, writeTextFile: false, }, terminal: false, @@ -312,18 +278,6 @@ const AUDIO_MIME_TYPES = new Set([ "audio/webm", ]); const ANTIGRAVITY_MAX_AUDIO_ATTACHMENT_BYTES = 20 * 1024 * 1024; -// The agent inlines linked video bytes into one model request, so keep it under the inline limit. -const ANTIGRAVITY_MAX_VIDEO_ATTACHMENT_BYTES = 20 * 1024 * 1024; - -/** - * Only Gemini takes video. The evidence is the session's resolved model, so an account default - * counts once the agent reports it; opaque ids such as `agy-model` need a Gemini display name. - */ -function antigravityModelAcceptsVideo( - model: { readonly id: string; readonly name: string | undefined } | undefined, -): boolean { - return model !== undefined && (/^gemini-/i.test(model.id) || /^gemini\b/i.test(model.name ?? "")); -} const TEXT_MIME_TYPES = new Set([ "application/json", "application/ld+json", @@ -393,9 +347,6 @@ export const buildAntigravityPrompt = Effect.fn("buildAntigravityPrompt")(functi attachment: NonNullable[number], ) => string | null; readonly promptCapabilities: EffectAcpSchema.AgentCapabilities["promptCapabilities"]; - /** Linked video needs a runtime whose `resource_link` handling is qualified and a Gemini model. */ - readonly agentVersion?: string | undefined; - readonly currentModel?: { readonly id: string; readonly name: string | undefined } | undefined; }): Effect.fn.Return< ReadonlyArray, EffectAcpErrors.AcpError, @@ -403,8 +354,6 @@ export const buildAntigravityPrompt = Effect.fn("buildAntigravityPrompt")(functi > { const fileSystem = yield* FileSystem.FileSystem; const path = yield* Path.Path; - // The agent runs on this host. - const platform = yield* HostProcess.Platform; const blocks: Array = []; const text = input.input?.trim(); if (text) blocks.push({ type: "text", text }); @@ -420,14 +369,6 @@ export const buildAntigravityPrompt = Effect.fn("buildAntigravityPrompt")(functi const image = attachment.type === "image" && IMAGE_MIME_TYPES.has(mimeType); const audio = attachment.type === "file" && AUDIO_MIME_TYPES.has(mimeType); const pdf = attachment.type === "file" && mimeType === "application/pdf"; - const video = - attachment.type === "file" && - mimeType === "video/mp4" && - isQualifiedAntigravityRelease(input.agentVersion) && - // The agent turns a file URI into a path with unquote(urlparse(uri).path), which drops - // Windows drives and UNC hosts. Keep the saved path there until Google fixes it. - platform !== "win32" && - antigravityModelAcceptsVideo(input.currentModel); const textFile = attachment.type === "file" && (mimeType.startsWith("text/") || @@ -439,9 +380,7 @@ export const buildAntigravityPrompt = Effect.fn("buildAntigravityPrompt")(functi (isPastedText || (audio ? input.promptCapabilities?.audio !== true - : pdf || textFile - ? input.promptCapabilities?.embeddedContext !== true - : !video))); + : !(pdf || textFile) || input.promptCapabilities?.embeddedContext !== true))); const attachmentPath = input.resolveAttachmentPath(attachment); if (!attachmentPath) { return yield* EffectAcpErrors.AcpRequestError.invalidParams( @@ -470,9 +409,7 @@ export const buildAntigravityPrompt = Effect.fn("buildAntigravityPrompt")(functi ? ANTIGRAVITY_MAX_AUDIO_ATTACHMENT_BYTES : pdf ? MAX_TOTAL_ATTACHMENT_BYTES - : video - ? ANTIGRAVITY_MAX_VIDEO_ATTACHMENT_BYTES - : ANTIGRAVITY_MAX_TEXT_ATTACHMENT_BYTES; + : ANTIGRAVITY_MAX_TEXT_ATTACHMENT_BYTES; if ( attachment.type === "file" && (size > limit || totalBytes + size > MAX_TOTAL_ATTACHMENT_BYTES) @@ -491,7 +428,7 @@ export const buildAntigravityPrompt = Effect.fn("buildAntigravityPrompt")(functi EffectAcpErrors.AcpRequestError.invalidParams(`Invalid attachment '${attachment.name}'.`), ), ); - if (pdf || video) { + if (pdf) { blocks.push({ type: "resource_link", uri, name: attachment.name, mimeType, size }); continue; } diff --git a/apps/server/src/provider/antigravityAuthSupport.test.ts b/apps/server/src/provider/antigravityAuthSupport.test.ts index e1b82931d810a..c0ac0db612e55 100644 --- a/apps/server/src/provider/antigravityAuthSupport.test.ts +++ b/apps/server/src/provider/antigravityAuthSupport.test.ts @@ -55,7 +55,7 @@ describe("Antigravity process environment", () => { browserCommand: "managed-browser-helper", }; - it("isolates the profile and harness after merging overrides without changing the base environment", () => { + it("runs `agy acp` with an isolated profile without changing the base environment", () => { const baseEnv = { HOME: "/home/developer", PATH: "/usr/bin", @@ -82,7 +82,7 @@ describe("Antigravity process environment", () => { }; const original = { ...baseEnv }; const spawn = buildAntigravityAcpSpawnInput({ - installation: { executablePath: "/release/acp", harnessPath: "/release/harness" }, + installation: { executablePath: "/usr/bin/agy" }, profile, cwd: "/project", baseEnv, @@ -90,8 +90,8 @@ describe("Antigravity process environment", () => { expect(baseEnv).toEqual(original); expect(spawn).toEqual({ - command: "/release/acp", - args: ["--uid="], + command: "/usr/bin/agy", + args: ["acp", "--gemini-dir", profile.geminiHome, "--app-data-dir", "antigravity-acp"], cwd: "/project", extendEnv: false, env: { @@ -100,7 +100,6 @@ describe("Antigravity process environment", () => { CUSTOM_SETTING: "keep-this", GEMINI_HOME: profile.geminiHome, AGY_ACP_FORCE_FILE_STORAGE: "1", - ANTIGRAVITY_HARNESS_PATH: "/release/harness", BROWSER: profile.browserCommand, PYTHONUNBUFFERED: "1", ELECTRON_RUN_AS_NODE: "1", @@ -109,31 +108,11 @@ describe("Antigravity process environment", () => { }); }); - it("runs the agy CLI as `agy acp` without a harness", () => { - const spawn = buildAntigravityAcpSpawnInput({ - installation: { executablePath: "/usr/bin/agy", harnessPath: null }, - profile, - cwd: "/project", - baseEnv: { PATH: "/usr/bin", ANTIGRAVITY_HARNESS_PATH: "/stale/harness" }, - }); - - expect(spawn.command).toBe("/usr/bin/agy"); - expect(spawn.args).toEqual([ - "acp", - "--gemini-dir", - profile.geminiHome, - "--app-data-dir", - "antigravity-acp", - ]); - expect(spawn.env).not.toHaveProperty("ANTIGRAVITY_HARNESS_PATH"); - expect(spawn.env).toMatchObject({ GEMINI_HOME: profile.geminiHome, PATH: "/usr/bin" }); - }); - it("passes only the configured method's credential and keeps the GCP pair out of the environment", () => { const baseEnv = { PATH: "/usr/bin", GOOGLE_API_KEY: "ambient-key" }; const spawnFor = (auth: AntigravityAuthConfig) => buildAntigravityAcpSpawnInput({ - installation: { executablePath: "/release/acp", harnessPath: "/release/harness" }, + installation: { executablePath: "/usr/bin/agy" }, profile, cwd: "/project", baseEnv, @@ -179,10 +158,7 @@ describe("Antigravity process environment", () => { browserCommand: "managed-browser-helper", }; const input = { - installation: { - executablePath: "C:\\release\\agy_acp_server.exe", - harnessPath: "C:\\release\\localharness_external.exe", - }, + installation: { executablePath: "C:\\release\\agy.exe" }, profile: windowsProfile, cwd: "C:\\project", baseEnv: { PATH: "C:\\Windows\\system32", TEMP: "C:\\Users\\user\\AppData\\Local\\Temp" }, @@ -502,7 +478,7 @@ it.layer(NodeServices.layer)("Antigravity profile preparation", (it) => { }), ); return buildAntigravityAcpSpawnInput({ - installation: { executablePath: "/release/acp", harnessPath: "/release/harness" }, + installation: { executablePath: "/usr/bin/agy" }, profile, cwd: directory, baseEnv, diff --git a/apps/server/src/provider/antigravityAuthSupport.ts b/apps/server/src/provider/antigravityAuthSupport.ts index 919d8b6144ffe..a98aadb15fbb1 100644 --- a/apps/server/src/provider/antigravityAuthSupport.ts +++ b/apps/server/src/provider/antigravityAuthSupport.ts @@ -457,10 +457,7 @@ export const prepareAntigravityProfile = Effect.fn("prepareAntigravityProfile")( }); export function buildAntigravityAcpSpawnInput(input: { - readonly installation: { - readonly executablePath: string; - readonly harnessPath: string | null; - }; + readonly installation: { readonly executablePath: string }; readonly profile: AntigravityProfile; readonly cwd: string; readonly baseEnv?: NodeJS.ProcessEnv; @@ -469,32 +466,21 @@ export function buildAntigravityAcpSpawnInput(input: { }): AcpSessionRuntime.AcpSpawnInput { return { command: input.installation.executablePath, - // The agy CLI has no harness sibling and serves ACP through its `acp` subcommand. - args: - input.installation.harnessPath === null - ? [ - "acp", - "--gemini-dir", - input.profile.geminiHome, - "--app-data-dir", - // The CLI joins this beneath gemini-dir, including when the value is absolute. - "antigravity-acp", - ] - : input.profile.platform === "linux" - ? ["--uid="] - : [], + args: [ + "acp", + "--gemini-dir", + input.profile.geminiHome, + "--app-data-dir", + // The CLI joins this beneath gemini-dir, including when the value is absolute. + "antigravity-acp", + ], cwd: input.cwd, - env: { - ...antigravityEnvironment( - input.profile, - input.baseEnv ?? process.env, - input.auth ?? ANTIGRAVITY_PERSONAL_AUTH, - input.runtimeTempDirectory, - ), - ...(input.installation.harnessPath === null - ? {} - : { ANTIGRAVITY_HARNESS_PATH: input.installation.harnessPath }), - }, + env: antigravityEnvironment( + input.profile, + input.baseEnv ?? process.env, + input.auth ?? ANTIGRAVITY_PERSONAL_AUTH, + input.runtimeTempDirectory, + ), extendEnv: false, }; } diff --git a/apps/server/src/provider/antigravityRelease.ts b/apps/server/src/provider/antigravityRelease.ts deleted file mode 100644 index 54702d69935fb..0000000000000 --- a/apps/server/src/provider/antigravityRelease.ts +++ /dev/null @@ -1,14 +0,0 @@ -export interface AntigravityReleaseAsset { - readonly version: string; - readonly url: string; - readonly sha256: string; - readonly archiveBytes: number; - readonly executable: { - readonly name: string; - readonly bytes: number; - }; - readonly harness: { - readonly name: string; - readonly bytes: number; - }; -} diff --git a/apps/server/src/provider/managedRelease.ts b/apps/server/src/provider/managedRelease.ts index ca7c55e43b595..2ab75a3d7b325 100644 --- a/apps/server/src/provider/managedRelease.ts +++ b/apps/server/src/provider/managedRelease.ts @@ -1,7 +1,6 @@ import { compareSemverVersions, parseSemver } from "@t3tools/shared/semver"; -// Older pins recorded non-semver versions such as `agy_acp_server_1.1.1`; any -// other release is an update from those. +// A non-semver installed version counts any other release as an update. const isNewer = (candidate: string, current: string) => parseSemver(candidate) && parseSemver(current) ? compareSemverVersions(candidate, current) > 0 diff --git a/apps/server/src/provider/providerCompatibility.test.ts b/apps/server/src/provider/providerCompatibility.test.ts index 8d81e19f6b5bd..6b561bf5120c7 100644 --- a/apps/server/src/provider/providerCompatibility.test.ts +++ b/apps/server/src/provider/providerCompatibility.test.ts @@ -111,39 +111,6 @@ describe("provider compatibility", () => { ); }); - it("recognizes Antigravity semver release tags while keeping dated candidates unknown", () => { - const antigravity = ProviderDriverKind.make("antigravity"); - const taggedPolicy = { - ...policy, - driver: antigravity, - ranges: [{ range: "=2.0.0", status: "supported" as const }], - }; - for (const [version, expected] of [ - ["agy_acp_server_2.0.0", "supported"], - ["2.0.0", "supported"], - ["agy_acp_server_2.0.1", "unknown"], - ["agy_acp_server_2.0.0-beta.1", "unknown"], - ["agy_acp_server_20260818_01_RC01", "unknown"], - ] as const) { - assert.strictEqual( - resolveProviderCompatibility([taggedPolicy], antigravity, version)?.status, - expected, - ); - } - }); - - it("supports a prefixed native Antigravity runtime in the bundled manifest", () => { - const policies = decodeCompatibilityPolicies(bundledManifest.compatibility); - assert.strictEqual( - resolveProviderCompatibility( - policies, - ProviderDriverKind.make("antigravity"), - "agy_acp_server_1.5.7", - )?.status, - "supported", - ); - }); - it("marks Antigravity below 1.5 broken and recommends 1.5.12 in the bundled manifest", () => { const policies = decodeCompatibilityPolicies(bundledManifest.compatibility); const antigravity = ProviderDriverKind.make("antigravity"); @@ -165,7 +132,6 @@ describe("provider compatibility", () => { ["v2.0.0", "supported"], ["3.0.0", "unknown"], ["2.0.0-beta.1", "unknown"], - ["agy_acp_server_20260818_01_RC01", "unknown"], [null, "unknown"], ] as const) { assert.strictEqual(resolveProviderCompatibility([policy], driver, version)?.status, expected); diff --git a/apps/server/src/provider/providerCompatibility.ts b/apps/server/src/provider/providerCompatibility.ts index 69322915f458a..3f08e2d92dbc3 100644 --- a/apps/server/src/provider/providerCompatibility.ts +++ b/apps/server/src/provider/providerCompatibility.ts @@ -65,15 +65,13 @@ export function resolveProviderCompatibility( ); if (!policy) return undefined; const unprefixed = version?.replace(/^v/, ""); - // Strip Cursor build hashes, Google ACP release prefixes and Muse revisions; leave semver prereleases unknown. + // Strip Cursor build hashes and Muse revisions; leave semver prereleases unknown. const stable = driver === "cursor" ? unprefixed?.replace(/^(\d{4}\.\d{2}\.\d{2})-[a-f0-9]+$/, "$1") - : driver === "antigravity" - ? unprefixed?.replace(/^agy_acp_server_(\d+\.\d+\.\d+)$/, "$1") - : driver === "muse" - ? unprefixed?.replace(/^(\d+\.\d+\.\d+)-R\d+(?:\.\d+)?$/, "$1") - : unprefixed; + : driver === "muse" + ? unprefixed?.replace(/^(\d+\.\d+\.\d+)-R\d+(?:\.\d+)?$/, "$1") + : unprefixed; const status = stable && /^\d+\.\d+\.\d+$/.test(stable) ? (policy.ranges.find((entry) => satisfiesSemverRange(stable, entry.range))?.status ?? diff --git a/apps/web/src/components/settings/providerStatus.ts b/apps/web/src/components/settings/providerStatus.ts index 36a31b0fccb04..e4b658123bf28 100644 --- a/apps/web/src/components/settings/providerStatus.ts +++ b/apps/web/src/components/settings/providerStatus.ts @@ -128,11 +128,6 @@ export function getProviderSummary( export function getProviderVersionLabel(version: string | null | undefined) { if (!version) return null; - const antigravity = /^agy_acp_server_(\d{4})(\d{2})(\d{2})_\d+(?:_(\w+))?$/.exec(version); - if (antigravity) { - const [, year, month, day, candidate] = antigravity; - return `${year}-${month}-${day}${candidate ? ` ${candidate}` : ""}`; - } return /^\d/.test(version) ? `v${version}` : version; } diff --git a/docs/user/providers-antigravity.md b/docs/user/providers-antigravity.md index c62cc56b310d6..750d450b49eea 100644 --- a/docs/user/providers-antigravity.md +++ b/docs/user/providers-antigravity.md @@ -69,10 +69,12 @@ is available. T3 checks Google's CLI release channel while provider update check are enabled. Installing or reinstalling also checks that channel. Updates keep your profile and existing runtime available if the new release fails validation. -Updating an older 1.4.5 installation migrates it to the native CLI. You may need to -sign in again after migration. Threads already running finish with their original -runtime; new sessions use the updated release. Custom binary paths keep using the -executable you selected. +T3 needs Antigravity 1.5 or newer and recommends 1.5.12 or newer. Sessions do not +start on an older runtime: update the managed runtime here, or update the executable +a custom binary path or `PATH` points at. You may need to sign in again after +updating from a runtime older than 1.5. Threads already running finish with their +original runtime; new sessions use the updated release. Custom binary paths keep +using the executable you selected. ## Models and threads @@ -148,8 +150,6 @@ is refused while the runtime is in use. When your Antigravity runtime offers `/goal`, send `/goal` followed by a verifiable objective. Antigravity keeps working until it completes the goal or you cancel it. -If you still use the older 1.4.5 runtime, update Antigravity in provider settings, -then refresh provider status. Use Stop to interrupt a running goal, then ask Antigravity to stop pursuing it before starting more work. Ordinary follow-ups wait until the running turn ends. diff --git a/packages/provider-acp/src/server/adapter.ts b/packages/provider-acp/src/server/adapter.ts index 33bc49ff8927a..48d003b68c4f0 100644 --- a/packages/provider-acp/src/server/adapter.ts +++ b/packages/provider-acp/src/server/adapter.ts @@ -352,9 +352,6 @@ export interface AcpAdapterV2Flavor { readonly attachments: ReadonlyArray; readonly resolveAttachmentPath: (attachment: ChatAttachment) => string | null; readonly promptCapabilities: EffectAcpSchema.AgentCapabilities["promptCapabilities"]; - readonly agentVersion: string | undefined; - /** The session's model after selection, with its display name when the agent lists it. */ - readonly currentModel: { readonly id: string; readonly name: string | undefined } | undefined; }) => Effect.Effect, EffectAcpErrors.AcpError>; readonly promptFailure?: (cause: unknown) => OrchestrationV2ProviderFailure; /** @@ -8587,24 +8584,12 @@ export const makeAcpAdapterV2 = Effect.fn("makeAcpAdapterV2")(function* ( : yield* imageAttachmentBlocks(turnInput.message.attachments); if (flavor.buildAttachmentPrompt) { const setup = yield* Ref.get(activeSessionSetup); - const modelOption = findModelConfigOption(yield* runtime.getConfigOptions); - const currentModelId = modelOption?.currentValue; const blocks = yield* flavor .buildAttachmentPrompt({ text: messageText, attachments: turnInput.message.attachments, resolveAttachmentPath: host.resolveAttachmentPath, promptCapabilities: setup?.initializeResult.agentCapabilities?.promptCapabilities, - agentVersion: setup?.initializeResult.agentInfo?.version, - currentModel: - typeof currentModelId !== "string" || modelOption === undefined - ? undefined - : { - id: currentModelId, - name: flattenSelectChoices(modelOption.options).find( - (choice) => choice.value === currentModelId, - )?.name, - }, }) .pipe( Effect.mapError( From cdc0443b89f72f9bc6f7c33dec232ceb4971133c Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 19 Nov 2026 06:16:23 +0000 Subject: [PATCH 05/11] test(server): port main's Windows EPERM rename test to the CLI asset Co-Authored-By: Claude Opus 5.5 --- apps/server/src/provider/AntigravityInstallation.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/server/src/provider/AntigravityInstallation.test.ts b/apps/server/src/provider/AntigravityInstallation.test.ts index 64efd1d2868ff..af7d089b0d849 100644 --- a/apps/server/src/provider/AntigravityInstallation.test.ts +++ b/apps/server/src/provider/AntigravityInstallation.test.ts @@ -1232,7 +1232,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst Effect.gen(function* () { const fs = yield* FileSystem.FileSystem; const path = yield* Path.Path; - const archive = Buffer.from(zipFixtures.windows, "base64"); + const archive = Buffer.from(serverContents); const releaseRenameDenied = yield* Deferred.make(); let releaseRenameDenials = 3; const { installation } = yield* makeHarness({ @@ -1271,9 +1271,9 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst yield* TestClock.adjust("30 seconds"); expect(yield* Fiber.join(terminal)).toMatchObject({ phase: "succeeded", - installedVersion: "fixture-new", + installedVersion: assetVersion, }); - expect((yield* installation.resolve()).version).toBe("fixture-new"); + expect((yield* installation.resolve()).version).toBe(assetVersion); }), ); From 6ddc65a9dfa0e34b06075905abeae54d11c100a4 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 19 Nov 2026 06:33:21 +0000 Subject: [PATCH 06/11] fix(server): a prefixed pre-CLI Antigravity version still resolves broken Co-Authored-By: Claude Opus 5.5 --- apps/server/src/provider/providerCompatibility.test.ts | 2 +- apps/server/src/provider/providerCompatibility.ts | 7 +++++-- docs/user/providers-antigravity.md | 5 ++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/server/src/provider/providerCompatibility.test.ts b/apps/server/src/provider/providerCompatibility.test.ts index 6b561bf5120c7..78dcf0d1f7858 100644 --- a/apps/server/src/provider/providerCompatibility.test.ts +++ b/apps/server/src/provider/providerCompatibility.test.ts @@ -114,7 +114,7 @@ describe("provider compatibility", () => { it("marks Antigravity below 1.5 broken and recommends 1.5.12 in the bundled manifest", () => { const policies = decodeCompatibilityPolicies(bundledManifest.compatibility); const antigravity = ProviderDriverKind.make("antigravity"); - for (const version of ["1.1.1", "1.3.0", "1.4.1", "1.4.5", "1.4.9"]) { + for (const version of ["1.1.1", "1.3.0", "1.4.1", "1.4.5", "1.4.9", "agy_acp_server_1.4.5"]) { const advisory = resolveProviderCompatibility(policies, antigravity, version); assert.strictEqual(advisory?.status, "broken", version); } diff --git a/apps/server/src/provider/providerCompatibility.ts b/apps/server/src/provider/providerCompatibility.ts index 3f08e2d92dbc3..25025816d6eab 100644 --- a/apps/server/src/provider/providerCompatibility.ts +++ b/apps/server/src/provider/providerCompatibility.ts @@ -65,13 +65,16 @@ export function resolveProviderCompatibility( ); if (!policy) return undefined; const unprefixed = version?.replace(/^v/, ""); - // Strip Cursor build hashes and Muse revisions; leave semver prereleases unknown. + // Strip Cursor build hashes, Muse revisions and the pre-CLI Antigravity prefix, so a + // pre-1.5 runtime behind a custom launcher still resolves broken; leave prereleases unknown. const stable = driver === "cursor" ? unprefixed?.replace(/^(\d{4}\.\d{2}\.\d{2})-[a-f0-9]+$/, "$1") : driver === "muse" ? unprefixed?.replace(/^(\d+\.\d+\.\d+)-R\d+(?:\.\d+)?$/, "$1") - : unprefixed; + : driver === "antigravity" + ? unprefixed?.replace(/^agy_acp_server_(\d+\.\d+\.\d+)$/, "$1") + : unprefixed; const status = stable && /^\d+\.\d+\.\d+$/.test(stable) ? (policy.ranges.find((entry) => satisfiesSemverRange(stable, entry.range))?.status ?? diff --git a/docs/user/providers-antigravity.md b/docs/user/providers-antigravity.md index 750d450b49eea..636e5070d8458 100644 --- a/docs/user/providers-antigravity.md +++ b/docs/user/providers-antigravity.md @@ -112,9 +112,8 @@ Skills for every project go in `~/.gemini/config/skills` or so a skill there only appears when the project itself is your home directory. Antigravity receives images and audio directly, and reads PDFs and text files as -documents. With the managed runtime on macOS and Linux, an MP4 video up to 20 MiB -is sent as video to Gemini models. Other attachments, and videos for other models, are passed as a -saved file path for the agent to inspect with its tools. +documents. Other attachments, including videos, are passed as a saved file path for +the agent to inspect with its tools. ### Subagents From 296604f9dcf24e5076cc6a687de6946f48ab5336 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 19 Nov 2026 06:44:03 +0000 Subject: [PATCH 07/11] fix(server): an Antigravity prerelease below 1.5 resolves broken Co-Authored-By: Claude Opus 5.5 --- apps/server/src/provider/providerCompatibility.test.ts | 10 +++++++++- apps/server/src/provider/providerCompatibility.ts | 6 +++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/apps/server/src/provider/providerCompatibility.test.ts b/apps/server/src/provider/providerCompatibility.test.ts index 78dcf0d1f7858..460709937f357 100644 --- a/apps/server/src/provider/providerCompatibility.test.ts +++ b/apps/server/src/provider/providerCompatibility.test.ts @@ -114,7 +114,15 @@ describe("provider compatibility", () => { it("marks Antigravity below 1.5 broken and recommends 1.5.12 in the bundled manifest", () => { const policies = decodeCompatibilityPolicies(bundledManifest.compatibility); const antigravity = ProviderDriverKind.make("antigravity"); - for (const version of ["1.1.1", "1.3.0", "1.4.1", "1.4.5", "1.4.9", "agy_acp_server_1.4.5"]) { + for (const version of [ + "1.1.1", + "1.3.0", + "1.4.1", + "1.4.5", + "1.4.9", + "agy_acp_server_1.4.5", + "1.4.5-beta", + ]) { const advisory = resolveProviderCompatibility(policies, antigravity, version); assert.strictEqual(advisory?.status, "broken", version); } diff --git a/apps/server/src/provider/providerCompatibility.ts b/apps/server/src/provider/providerCompatibility.ts index 25025816d6eab..d825eb1b24342 100644 --- a/apps/server/src/provider/providerCompatibility.ts +++ b/apps/server/src/provider/providerCompatibility.ts @@ -65,15 +65,15 @@ export function resolveProviderCompatibility( ); if (!policy) return undefined; const unprefixed = version?.replace(/^v/, ""); - // Strip Cursor build hashes, Muse revisions and the pre-CLI Antigravity prefix, so a - // pre-1.5 runtime behind a custom launcher still resolves broken; leave prereleases unknown. + // Strip Cursor build hashes and Muse revisions; leave other prereleases unknown. Antigravity + // drops its pre-CLI prefix and prerelease suffix, so a custom launcher below 1.5 resolves broken. const stable = driver === "cursor" ? unprefixed?.replace(/^(\d{4}\.\d{2}\.\d{2})-[a-f0-9]+$/, "$1") : driver === "muse" ? unprefixed?.replace(/^(\d+\.\d+\.\d+)-R\d+(?:\.\d+)?$/, "$1") : driver === "antigravity" - ? unprefixed?.replace(/^agy_acp_server_(\d+\.\d+\.\d+)$/, "$1") + ? unprefixed?.replace(/^(?:agy_acp_server_)?(\d+\.\d+\.\d+)(?:-[0-9A-Za-z.-]+)?$/, "$1") : unprefixed; const status = stable && /^\d+\.\d+\.\d+$/.test(stable) From 821bf010702ceb6af0f5a1d8acf18125f75f0a06 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 19 Nov 2026 15:07:51 -0800 Subject: [PATCH 08/11] fix(server): releases that cannot install the Antigravity CLI keep their policy The manifest is fetched from main by every release. Releases before 0.1.10 pin runtime 1.4.5 and cannot install the CLI, so the below-1.5 broken policy now starts at 0.1.10. Model refresh on a refused runtime shows the version message, and the web version label keeps its date formatting. Co-Authored-By: Claude Fable 5.2 --- .../src/provider/Drivers/AntigravityDriver.test.ts | 6 +++--- .../src/provider/Drivers/AntigravityDriver.ts | 6 +++++- apps/server/src/provider/model-manifest.json | 13 ++++++++++++- .../src/provider/providerCompatibility.test.ts | 5 +++++ 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/apps/server/src/provider/Drivers/AntigravityDriver.test.ts b/apps/server/src/provider/Drivers/AntigravityDriver.test.ts index 2adb02b6a6b44..b8df7137873f7 100644 --- a/apps/server/src/provider/Drivers/AntigravityDriver.test.ts +++ b/apps/server/src/provider/Drivers/AntigravityDriver.test.ts @@ -562,9 +562,9 @@ it.layer(layerTest)("AntigravityDriver", (it) => { yield* session.ensureThread({ threadId, modelSelection, runtimePolicy }); }), ).pipe(Effect.flip); - expect(knownProviderFailureMessage(error)).toBe( - `Antigravity 1.4.5 does not work with this T3 Code release. Update the Antigravity executable at ${old.executablePath} to >=1.5.12 <2, then retry.`, - ); + const message = `Antigravity 1.4.5 does not work with this T3 Code release. Update the Antigravity executable at ${old.executablePath} to >=1.5.12 <2, then retry.`; + expect(knownProviderFailureMessage(error)).toBe(message); + expect((yield* h.refresh().pipe(Effect.flip)).detail).toBe(message); const methods = (yield* h.readRequests).map((request) => request.method); expect(methods).toContain("initialize"); expect(methods).not.toContain("session/new"); diff --git a/apps/server/src/provider/Drivers/AntigravityDriver.ts b/apps/server/src/provider/Drivers/AntigravityDriver.ts index 0a6fed4091175..6f6bb508a4d29 100644 --- a/apps/server/src/provider/Drivers/AntigravityDriver.ts +++ b/apps/server/src/provider/Drivers/AntigravityDriver.ts @@ -565,7 +565,11 @@ export const AntigravityDriver: ProviderDriver< : cause._tag === "ProviderSetupError" && (cause.operation === "configure" || cause.operation === "start") ? cause.detail - : refreshFailureDetail(cause), + : cause._tag === "AcpTransportError" && + cause.cause instanceof ProviderSetupError && + cause.cause.operation === "runtime" + ? cause.cause.detail + : refreshFailureDetail(cause), cause, }), ), diff --git a/apps/server/src/provider/model-manifest.json b/apps/server/src/provider/model-manifest.json index 49dcc07866eba..c719c3755acd4 100644 --- a/apps/server/src/provider/model-manifest.json +++ b/apps/server/src/provider/model-manifest.json @@ -74,7 +74,18 @@ }, { "driver": "antigravity", - "t3CodeRange": ">=0.0.42", + "t3CodeRange": ">=0.0.42 <0.1.10", + "recommendedRange": "=1.4.5 || =1.4.1", + "ranges": [ + { "range": "=1.4.5", "status": "supported" }, + { "range": "=1.4.1", "status": "supported" }, + { "range": "=1.3.0", "status": "supported" }, + { "range": "=1.1.1", "status": "supported" } + ] + }, + { + "driver": "antigravity", + "t3CodeRange": ">=0.1.10", "recommendedRange": ">=1.5.12 <2", "ranges": [ { "range": ">=1.5.0 <2", "status": "supported" }, diff --git a/apps/server/src/provider/providerCompatibility.test.ts b/apps/server/src/provider/providerCompatibility.test.ts index 460709937f357..2c5be6d220b14 100644 --- a/apps/server/src/provider/providerCompatibility.test.ts +++ b/apps/server/src/provider/providerCompatibility.test.ts @@ -129,6 +129,11 @@ describe("provider compatibility", () => { const supported = resolveProviderCompatibility(policies, antigravity, "1.5.11"); assert.strictEqual(supported?.status, "supported"); assert.strictEqual(supported?.recommendedRange, ">=1.5.12 <2"); + // Releases before 0.1.10 cannot install the CLI, so they keep the policy they shipped with. + assert.strictEqual( + resolveProviderCompatibility(policies, antigravity, "1.4.5", "0.1.9")?.status, + "supported", + ); }); it("classifies boundaries and treats unlisted versions and release tags as unknown", () => { From 0388ac67280c3c76efbceb2af5c3efbef422013d Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 19 Nov 2026 15:18:14 -0800 Subject: [PATCH 09/11] fix(server): use Schema.is for the refused-runtime refresh message Co-Authored-By: Claude Fable 5.2 --- apps/server/src/provider/Drivers/AntigravityDriver.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/server/src/provider/Drivers/AntigravityDriver.ts b/apps/server/src/provider/Drivers/AntigravityDriver.ts index 6f6bb508a4d29..4292da255b1d9 100644 --- a/apps/server/src/provider/Drivers/AntigravityDriver.ts +++ b/apps/server/src/provider/Drivers/AntigravityDriver.ts @@ -81,6 +81,7 @@ const DRIVER = ProviderDriverKind.make("antigravity"); const decodeSettings = Schema.decodeSync(AntigravitySettings); const isNodeRuntimeUnavailableError = Schema.is(NodeRuntimeUnavailableError); const isAcpRequestError = Schema.is(AcpErrors.AcpRequestError); +const isProviderSetupError = Schema.is(ProviderSetupError); const isAcpErrorDetails = Schema.is(Schema.Struct({ details: Schema.String })); const REFRESH_FAILED = "Could not refresh Antigravity models. The previous model list is unchanged."; @@ -566,7 +567,7 @@ export const AntigravityDriver: ProviderDriver< (cause.operation === "configure" || cause.operation === "start") ? cause.detail : cause._tag === "AcpTransportError" && - cause.cause instanceof ProviderSetupError && + isProviderSetupError(cause.cause) && cause.cause.operation === "runtime" ? cause.cause.detail : refreshFailureDetail(cause), From a72c7d7d6a58a1f69591ddce455d3241a4b6016f Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 19 Nov 2026 16:04:49 -0800 Subject: [PATCH 10/11] fix(server): drop the pre-1.5 Antigravity sign-in guards and harness-failure detector Main's native-CLI sign-in (#38953) read harnessPath, which this branch removes. The stderr harness-failure detector matched logs only the pre-1.5 runtime wrote. An old managed install now reports its version and the update instruction at startup instead of asking for a reinstall. Co-Authored-By: Claude Fable 5.2 --- apps/server/scripts/acp-mock-agent.ts | 28 +--- .../Adapters/AntigravityAdapterV2.test.ts | 150 ------------------ .../provider/AntigravityInstallation.test.ts | 2 +- .../src/provider/AntigravityInstallation.ts | 8 +- .../src/provider/Drivers/AntigravityDriver.ts | 8 +- .../provider/antigravityAuthSupport.test.ts | 32 ---- .../src/provider/antigravityAuthSupport.ts | 15 +- docs/user/providers-antigravity.md | 23 +-- 8 files changed, 15 insertions(+), 251 deletions(-) diff --git a/apps/server/scripts/acp-mock-agent.ts b/apps/server/scripts/acp-mock-agent.ts index fe97d392b5d3e..9564129a0b8b5 100644 --- a/apps/server/scripts/acp-mock-agent.ts +++ b/apps/server/scripts/acp-mock-agent.ts @@ -18,7 +18,6 @@ import { beginAcpMockPrompt } from "./acpMockCancellationState.ts"; const requestLogPath = process.env.T3_ACP_REQUEST_LOG_PATH; const antigravityProfile = process.env.T3_ACP_ANTIGRAVITY === "1"; -const harnessFailure = process.env.T3_ACP_ANTIGRAVITY_HARNESS_FAILURE; // GitHub Copilot CLI advertises URL-shaped session mode ids. const copilotModesProfile = process.env.T3_ACP_COPILOT_MODES === "1"; const copilotModeId = (name: string) => @@ -522,16 +521,6 @@ const program = Effect.gen(function* () { }, }); - const writeHarnessFailure = Effect.promise( - () => - new Promise((resolve) => { - process.stderr.write( - "I1022 11:04:37.910207 1865358 local_connection.py:551] harness stderr: Agent run failed: failed to handle call hook response: no pending hook for ID hook_request_2\n", - () => resolve(), - ); - }), - ); - const finishPrompt = ( targetSessionId: string, stopReason: AcpSchema.StopReason, @@ -1055,19 +1044,6 @@ const program = Effect.gen(function* () { ); return {}; } - if ( - harnessFailure === "1" || - harnessFailure === "pending" || - harnessFailure === "after-end-turn" - ) { - if (harnessFailure === "after-end-turn") { - return yield* finishPrompt(requestedSessionId, "end_turn"); - } - yield* writeHarnessFailure; - if (harnessFailure === "pending") return yield* Effect.never; - return yield* finishPrompt(requestedSessionId, "end_turn"); - } - if (clientFsProbePath !== undefined && clientFsProbeLogPath !== undefined) { const probes = [ [ @@ -2210,9 +2186,7 @@ const program = Effect.gen(function* () { typeof params === "object" && params !== null ? Reflect.get(params, "code") : undefined; process.exit(typeof code === "number" ? code : 19); }) - : method === "_test/harness-failure" - ? writeHarnessFailure - : Effect.void, + : Effect.void, ); return yield* Effect.never; diff --git a/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts b/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts index 596a638550e2a..9423137bf4601 100644 --- a/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts +++ b/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts @@ -166,156 +166,6 @@ const layerSession = Layer.mergeAll( ), ); -describe("AntigravityAdapterV2 harness recovery", () => { - const recoverHarnessFailure = ( - harnessFailure: "1" | "pending" | "after-end-turn", - firstTurnStatuses: ReadonlyArray<"failed" | "completed">, - ) => { - let terminationCount = 0; - return Effect.gen(function* () { - const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; - const fileSystem = yield* FileSystem.FileSystem; - const path = yield* Path.Path; - const crypto = yield* SecureRandom.SecureRandom; - const mockAgentPath = yield* path.fromFileUrl( - new URL("../../../scripts/acp-mock-agent.ts", import.meta.url), - ); - const workspace = yield* fileSystem.makeTempDirectoryScoped(); - const requestLogPath = path.join(workspace, "requests.jsonl"); - let processCount = 0; - const firstRuntimeTerminated = yield* Deferred.make(); - let firstRuntime: AcpSessionRuntime.AcpSessionRuntime["Service"] | undefined; - const instanceId = ProviderInstanceId.make("antigravity-recovery-test"); - const adapter = yield* makeAntigravityAdapterV2({ - instanceId, - selfInvocation: yield* resolveSelfInvocation(), - makeRuntime: (input) => - Effect.suspend(() => { - processCount += 1; - const processNumber = processCount; - return makeAntigravityAcpRuntime({ - ...input, - onTermination: (error) => - (input.onTermination?.(error) ?? Effect.void).pipe( - Effect.tap( - Effect.sync(() => { - terminationCount += 1; - }), - ), - Effect.andThen( - processNumber === 1 - ? Deferred.succeed(firstRuntimeTerminated, undefined) - : Effect.void, - ), - ), - childProcessSpawner, - spawn: { - command: process.execPath, - args: [mockAgentPath], - cwd: input.cwd, - env: { - T3_ACP_ANTIGRAVITY: "1", - T3_ACP_REQUEST_LOG_PATH: requestLogPath, - ...(processNumber === 1 - ? { T3_ACP_ANTIGRAVITY_HARNESS_FAILURE: harnessFailure } - : {}), - }, - }, - }).pipe( - Effect.provideService(SecureRandom.SecureRandom, crypto), - Effect.tap((runtime) => - Effect.sync(() => { - if (processNumber === 1) firstRuntime = runtime; - }), - ), - ); - }), - withProcess: (_stop, task) => task, - defaultModel: Effect.undefined, - }); - const threadId = ThreadId.make("thread-antigravity-recovery"); - const modelSelection = { instanceId, model: "gemini-test-low" } as const; - const runtimePolicy = ProviderAdapter.ProviderAdapterV2RuntimePolicy.make({ - runtimeMode: "full-access", - interactionMode: "default", - cwd: workspace, - }); - const session = yield* adapter.openSession({ - threadId, - providerSessionId: ProviderSessionId.make("provider-session-antigravity-recovery"), - modelSelection, - runtimePolicy, - }); - const events = yield* Queue.unbounded(); - yield* session.events.pipe( - Stream.runForEach((event) => Queue.offer(events, event)), - Effect.forkScoped, - ); - const providerThread = yield* session.ensureThread({ - threadId, - modelSelection, - runtimePolicy, - }); - const now = yield* DateTime.now; - const terminal = Stream.fromQueue(events).pipe( - Stream.filter((event) => event.type === "turn.terminal"), - Stream.runHead, - ); - yield* session.startTurn( - makeTurnInput({ threadId, providerThread, instanceId, runtimePolicy, modelSelection, now }), - ); - const first = yield* terminal; - assert.equal(first._tag, "Some"); - if (first._tag === "Some") assert.include(firstTurnStatuses, first.value.status); - if (harnessFailure === "after-end-turn") { - assert.exists(firstRuntime); - yield* firstRuntime!.notify("_test/harness-failure", {}); - } - // The adapter must retire the first process even when end_turn won the race. - yield* Deferred.await(firstRuntimeTerminated); - yield* session.startTurn( - makeTurnInput({ - threadId, - providerThread, - instanceId, - runtimePolicy, - modelSelection, - now, - ordinal: 2, - }), - ); - const completed = yield* terminal; - assert.equal(completed._tag, "Some"); - if (completed._tag === "Some") assert.equal(completed.value.status, "completed"); - assert.equal(processCount, 2); - assert.equal(terminationCount, 1); - const requests = (yield* fileSystem.readFileString(requestLogPath)) - .trim() - .split("\n") - .map((line) => JSON.parse(line) as { method?: string; params?: { sessionId?: string } }); - const resumeRequests = requests.filter((request) => request.method === "session/resume"); - assert.equal(resumeRequests.length, 1); - assert.equal(resumeRequests[0]?.params?.sessionId, "mock-session-1"); - }).pipe( - Effect.provide(layerSession), - Effect.scoped, - Effect.tap(Effect.sync(() => assert.equal(terminationCount, 1))), - ); - }; - - it.live("fails an open turn and resumes its saved session after a harness failure", () => - recoverHarnessFailure("pending", ["failed"]), - ); - - it.live("resumes the saved session after a harness failure races end_turn", () => - recoverHarnessFailure("1", ["failed", "completed"]), - ); - - it.live("resumes in a fresh process when the native failure arrives after end_turn", () => - recoverHarnessFailure("after-end-turn", ["completed"]), - ); -}); - describe("AntigravityAdapterV2 compaction", () => { it.live.each([ { nativeGoals: false, compact: false }, diff --git a/apps/server/src/provider/AntigravityInstallation.test.ts b/apps/server/src/provider/AntigravityInstallation.test.ts index af7d089b0d849..5cd8d029e0340 100644 --- a/apps/server/src/provider/AntigravityInstallation.test.ts +++ b/apps/server/src/provider/AntigravityInstallation.test.ts @@ -284,7 +284,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst ); expect(yield* installation.resolve().pipe(Effect.flip)).toMatchObject({ operation: "resolve", - detail: expect.stringContaining("Update it in Antigravity setup"), + detail: expect.stringContaining("Antigravity 1.4.5 predates the Antigravity CLI"), }); yield* installation.start; expect(yield* terminalState(installation)).toMatchObject({ diff --git a/apps/server/src/provider/AntigravityInstallation.ts b/apps/server/src/provider/AntigravityInstallation.ts index e179eb5020f46..a51b4f25d9e35 100644 --- a/apps/server/src/provider/AntigravityInstallation.ts +++ b/apps/server/src/provider/AntigravityInstallation.ts @@ -291,7 +291,7 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma if (record.releaseId === releaseId && record.executable.name !== cliExecutableName) { return yield* installationError( "resolve", - "This managed Antigravity runtime predates the Antigravity CLI and no longer works. Update it in Antigravity setup.", + `Antigravity ${record.version} predates the Antigravity CLI and no longer works with this T3 Code release. Update it in Antigravity setup.`, ); } if ( @@ -1015,14 +1015,16 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma installedVersion: installed.version, })); }).pipe( - Effect.catch(() => + Effect.catch((cause) => SubscriptionRef.update( state, (current) => ({ ...current, phase: "failed", - message: "The managed Antigravity runtime is incomplete. Remove it and reinstall.", + message: isInstallationError(cause) + ? cause.detail + : "The managed Antigravity runtime is incomplete. Remove it and reinstall.", }) satisfies ProviderInstallState, ), ), diff --git a/apps/server/src/provider/Drivers/AntigravityDriver.ts b/apps/server/src/provider/Drivers/AntigravityDriver.ts index 55d8dd4f340b1..45ec6920499f6 100644 --- a/apps/server/src/provider/Drivers/AntigravityDriver.ts +++ b/apps/server/src/provider/Drivers/AntigravityDriver.ts @@ -18,7 +18,6 @@ import * as Effect from "effect/Effect"; import * as Exit from "effect/Exit"; import * as Fiber from "effect/Fiber"; import * as FileSystem from "effect/FileSystem"; -import * as Option from "effect/Option"; import * as Path from "effect/Path"; import * as Schema from "effect/Schema"; import * as Scope from "effect/Scope"; @@ -399,10 +398,6 @@ export const AntigravityDriver: ProviderDriver< readonly onAuthorizationUrl: (url: string) => Effect.Effect; }) { if (auth.authMethod !== "oauth-personal") return undefined; - const resolved = yield* installation - .resolve(settings.binaryPath, processEnvironment) - .pipe(Effect.option); - if (Option.isSome(resolved) && resolved.value.harnessPath !== null) return undefined; const cwd = yield* fileSystem .makeTempDirectoryScoped({ prefix: "t3-antigravity-login-" }) .pipe( @@ -415,8 +410,7 @@ export const AntigravityDriver: ProviderDriver< }), ), ); - const { executable, spawn } = yield* prepareSpawn(cwd, processEnvironment); - if (executable.harnessPath !== null) return undefined; + const { spawn } = yield* prepareSpawn(cwd, processEnvironment); const failed = (detail: string, cause?: unknown) => new ProviderSetupError({ instanceId, operation: "start", detail, cause }); // Without a display it prints the link only, instead of opening a browser on this machine. diff --git a/apps/server/src/provider/antigravityAuthSupport.test.ts b/apps/server/src/provider/antigravityAuthSupport.test.ts index 35d65ec1b1cf3..28444db4cbe7b 100644 --- a/apps/server/src/provider/antigravityAuthSupport.test.ts +++ b/apps/server/src/provider/antigravityAuthSupport.test.ts @@ -72,7 +72,6 @@ describe("Antigravity process environment", () => { GEMINI_HOME: "/shared-gemini-home", gemini_home: "/alias-shared-home", AGY_ACP_FORCE_FILE_STORAGE: "0", - ANTIGRAVITY_HARNESS_PATH: "/wrong-version/harness", BROWSER: "open-real-browser", browser: "another-real-browser", PYTHONUNBUFFERED: "0", @@ -418,37 +417,6 @@ describe("Antigravity stdout compatibility", () => { }); describe("Antigravity stderr compatibility", () => { - it.effect.each([ - "I1022 11:04:37.910207 1865358 local_connection.py:551] harness stderr: Agent run failed: failed to handle call hook response: no pending hook for ID hook_request_2", - "E1022 11:04:37.910207 1865358 server.py:5275] Failed to rebuild agent for session native-session; connection unrecoverable", - "E1022 11:04:37.910207 1865358 server.py:5266] Agent connection lost for session native-session after rebuild retry", - ])("retires the transport on a native harness failure: %s", (line) => - Effect.gen(function* () { - const handleStderr = makeAntigravityStderrHandler(); - yield* handleStderr(line.slice(0, 70)); - const error = yield* handleStderr(`${line.slice(70)}\r\n`).pipe(Effect.flip); - expect(error._tag).toBe("AcpTransportError"); - expect(error.message).not.toContain("native-session"); - expect(error.message).not.toContain("hook_request_2"); - }), - ); - - it.effect( - "does not classify task prose or unrelated native warnings as a transport failure", - () => - Effect.gen(function* () { - const handleStderr = makeAntigravityStderrHandler(); - yield* handleStderr("Agent run failed: example from a task\n"); - yield* handleStderr("Agent connection was lost and could not be re-established\n"); - yield* handleStderr( - "I1022 11:04:37.910207 1865358 server.py:5142] Agent connection closed for session native-session; rebuilding agent and retrying the turn once.\n", - ); - yield* handleStderr( - "W1022 11:04:37.910207 1865358 telemetry.py:431] No business auth manager configured\n", - ); - }), - ); - it.effect("forwards fragmented native sign-in URLs from runtime 1.1.1", () => Effect.gen(function* () { const urls: string[] = []; diff --git a/apps/server/src/provider/antigravityAuthSupport.ts b/apps/server/src/provider/antigravityAuthSupport.ts index 828e6c60b7a05..f16b15a522f5d 100644 --- a/apps/server/src/provider/antigravityAuthSupport.ts +++ b/apps/server/src/provider/antigravityAuthSupport.ts @@ -72,7 +72,6 @@ const removedEnvironmentKeys = new Set([ "AGY_ACP_ENABLE_OAUTH", "GEMINI_HOME", "AGY_ACP_FORCE_FILE_STORAGE", - "ANTIGRAVITY_HARNESS_PATH", "BROWSER", "PYTHONUNBUFFERED", "ELECTRON_RUN_AS_NODE", @@ -622,10 +621,6 @@ export function makeAntigravityStdoutTransform( }); } -// glog records from the managed harness after which its ACP process can no longer run a turn. -const ANTIGRAVITY_HARNESS_FAILURE_LOG = - /^[IWEF]\d{4} \d{2}:\d{2}:\d{2}\.\d+ +\d+ (?:local_connection\.py:\d+\] harness stderr: Agent run failed:|server\.py:\d+\] (?:Failed to rebuild agent for session |Agent connection lost for session ))/; - export function makeAntigravityStderrHandler( input: { readonly onAuthorizationUrl?: ( @@ -634,18 +629,10 @@ export function makeAntigravityStderrHandler( } = {}, ) { let pending = ""; - // Untraced: with native logs on stderr this runs for every harness log line. + // Untraced: this runs for every stderr line. const handleLine = Effect.fnUntraced(function* (line: string) { const message = line.endsWith("\r") ? line.slice(0, -1) : line; if (message.length > maxBrowserHelperLineLength) return; - if (ANTIGRAVITY_HARNESS_FAILURE_LOG.test(message)) { - return yield* new AcpErrors.AcpTransportError({ - method: "session/prompt", - detail: - "Antigravity's local agent connection failed. Send a follow-up to resume with a fresh process.", - cause: undefined, - }); - } const url = message.startsWith(ANTIGRAVITY_AUTH_STDOUT_PREFIX) ? Effect.succeed(message.slice(ANTIGRAVITY_AUTH_STDOUT_PREFIX.length)) : message.startsWith(ANTIGRAVITY_AUTH_BROWSER_MARKER) diff --git a/docs/user/providers-antigravity.md b/docs/user/providers-antigravity.md index 31a7e8cfd53d6..1720baa5e6f2e 100644 --- a/docs/user/providers-antigravity.md +++ b/docs/user/providers-antigravity.md @@ -18,23 +18,12 @@ Antigravity setup. ### Sign in from a remote device -With the native CLI, Google finishes on an Antigravity page that shows a code. Paste that -code, or the page's full address, into the code field in the client where you started -sign-in. This works the same from any device. - -With the older 1.4.5 runtime, Google returns to a `127.0.0.1` address. It can finish directly when your browser is -on the environment's machine. From another device, the final page will usually -fail to load because the sign-in listener is on the environment. - -Copy the full return address, including everything after `?`, into the return URL -field in the client where you started sign-in, then choose -**Continue**. Keep the original address; do not replace it with the server's -hostname. Only that T3 Code sign-in session can finish the attempt. If it expires, -retry sign-in and use the new link. - -The return URL contains a temporary sign-in code. Paste it only into the setup -field. A successful callback page alone does not confirm account access; wait for -T3 Code's confirmation. +Google finishes on an Antigravity page that shows a code. Paste that code, or the +page's full address, into the code field in the client where you started sign-in. +This works the same from any device. + +The code is temporary. Paste it only into the setup field. The page alone does not +confirm account access; wait for T3 Code's confirmation. ### Other sign-in methods From 6af421c4ba4395d2b44b079ecc4263ef4ee9a85f Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 19 Nov 2026 16:34:08 -0800 Subject: [PATCH 11/11] test(server): drop a stale Antigravity harness fixture line Co-Authored-By: Claude Fable 5.2 --- apps/server/src/provider/Drivers/AntigravityDriver.test.ts | 1 - apps/server/src/provider/providerCompatibility.test.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/server/src/provider/Drivers/AntigravityDriver.test.ts b/apps/server/src/provider/Drivers/AntigravityDriver.test.ts index b8df7137873f7..3c0135f419c66 100644 --- a/apps/server/src/provider/Drivers/AntigravityDriver.test.ts +++ b/apps/server/src/provider/Drivers/AntigravityDriver.test.ts @@ -235,7 +235,6 @@ const makeHarness = Effect.fn("makeAntigravityDriverHarness")(function* ( { name: "GOOGLE_APPLICATION_CREDENTIALS", value: "/must-not-be-used.json" }, { name: "GOOGLE_GENAI_USE_VERTEXAI", value: "true" }, { name: "GEMINI_HOME", value: "/must-not-be-used" }, - { name: "ANTIGRAVITY_HARNESS_PATH", value: "/must-not-be-used" }, { name: "BROWSER", value: "must-not-run" }, ...(options.environment ?? []), ].map((variable) => ({ ...variable, sensitive: false })), diff --git a/apps/server/src/provider/providerCompatibility.test.ts b/apps/server/src/provider/providerCompatibility.test.ts index 2c5be6d220b14..1eaa22920e634 100644 --- a/apps/server/src/provider/providerCompatibility.test.ts +++ b/apps/server/src/provider/providerCompatibility.test.ts @@ -129,7 +129,7 @@ describe("provider compatibility", () => { const supported = resolveProviderCompatibility(policies, antigravity, "1.5.11"); assert.strictEqual(supported?.status, "supported"); assert.strictEqual(supported?.recommendedRange, ">=1.5.12 <2"); - // Releases before 0.1.10 cannot install the CLI, so they keep the policy they shipped with. + // Stable releases before 0.1.10 cannot install the CLI, so they keep the policy they shipped with. assert.strictEqual( resolveProviderCompatibility(policies, antigravity, "1.4.5", "0.1.9")?.status, "supported",