From aa287a30e1bc05efea4e64621b973339c2f6611b Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Sat, 7 Nov 2026 12:05:15 +0000 Subject: [PATCH 1/2] test(server): reproduce #32457 Windows Antigravity install failing on validation cleanup On Windows the default runtime validation kills the ACP process in a scope finalizer. When that process has already exited, the kill fails and Effect.orDie turns the best-effort cleanup into a defect, so the install reports failed. This test drives the win32 branch with a real Node child that exits after answering initialize. AI-assisted; verified with the tests and tools listed above. Co-Authored-By: Claude Opus 5.5 --- .../provider/AntigravityInstallation.test.ts | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/apps/server/src/provider/AntigravityInstallation.test.ts b/apps/server/src/provider/AntigravityInstallation.test.ts index a8a83bec9548f..9233f5ac08037 100644 --- a/apps/server/src/provider/AntigravityInstallation.test.ts +++ b/apps/server/src/provider/AntigravityInstallation.test.ts @@ -845,6 +845,60 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst }), ); + it.effect("installs on Windows when the validation process exits before it is killed", () => + Effect.gen(function* () { + const nodeSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; + const initializeResult = { + protocolVersion: 1, + agentInfo: { name: "antigravity-acp", version: "fixture-new" }, + agentCapabilities: { + loadSession: true, + sessionCapabilities: { resume: {} }, + auth: { logout: {} }, + }, + authMethods: [{ id: "oauth-personal", name: "Google" }], + }; + const agent = ` + const result = ${JSON.stringify(initializeResult)}; + require("node:readline") + .createInterface({ input: process.stdin }) + .once("line", (line) => { + const { id } = JSON.parse(line); + const response = JSON.stringify({ jsonrpc: "2.0", id, result }) + "\\n"; + process.stdout.write(response, () => process.exit(0)); + }); + `; + const archive = Buffer.from(zipFixtures.windows, "base64"); + const { installation } = yield* makeHarness({ + platform: "win32", + archive, + useDefaultValidation: true, + spawner: ChildProcessSpawner.make((command) => { + if ( + !ChildProcess.isStandardCommand(command) || + !command.command.endsWith("agy_acp_server.exe") + ) { + return nodeSpawner.spawn(command); + } + return nodeSpawner.spawn(ChildProcess.make(process.execPath, ["-e", agent])).pipe( + Effect.map((child) => + ChildProcessSpawner.makeHandle({ + ...child, + // The runtime exits on its own before cleanup; Node then refuses the kill. + kill: (options) => child.exitCode.pipe(Effect.andThen(child.kill(options))), + }), + ), + ); + }), + }); + yield* installation.start; + expect(yield* terminalState(installation)).toMatchObject({ + phase: "succeeded", + installedVersion: "fixture-new", + }); + }), + ); + it.effect("reports unsupported hosts without downloading or changing state", () => Effect.gen(function* () { const { installation, requests } = yield* makeHarness({ asset: null, platform: "darwin" }); From e3df082ed3d42f44a8dbe89231a13f9a6f4c0163 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Sat, 7 Nov 2026 12:07:20 +0000 Subject: [PATCH 2/2] fix(server): Windows Antigravity install survives validation cleanup kill failure When the Antigravity validation runtime had already exited, the Windows finalizer's best-effort kill failed and Effect.orDie turned that into a defect that rolled back an install whose validation had passed. Ignore the kill failure, matching other best-effort child kills in the server. Fixes pingdotgg/t3code#32457 Co-Authored-By: Claude Opus 5.5 --- apps/server/src/provider/AntigravityInstallation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/server/src/provider/AntigravityInstallation.ts b/apps/server/src/provider/AntigravityInstallation.ts index a89f1ab25b501..45d9df420ae42 100644 --- a/apps/server/src/provider/AntigravityInstallation.ts +++ b/apps/server/src/provider/AntigravityInstallation.ts @@ -394,7 +394,7 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma // Stop PyInstaller's tree before ACP closes pipes; after launcher exit, taskkill cannot reach children holding DLLs open. yield* Scope.addFinalizer( validationScope, - child.kill({ forceKillAfter: "1 second" }).pipe(Effect.orDie), + child.kill({ forceKillAfter: "1 second" }).pipe(Effect.ignore), ); return child; }),