Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions apps/server/src/provider/AntigravityInstallation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1500,6 +1500,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("publishes a Windows release once a transient EPERM on the release rename clears", () =>
Effect.gen(function* () {
const fs = yield* FileSystem.FileSystem;
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/provider/AntigravityInstallation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,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;
}),
Expand Down
Loading