From 26bddb09f18bfaa8ddc1c2cfc3bebf2549b9691a Mon Sep 17 00:00:00 2001 From: Dotta Date: Mon, 23 Nov 2026 23:12:38 -0600 Subject: [PATCH] test(server): the swarm provider mode is set only for a trusted Antigravity swarm run Co-Authored-By: Claude Opus 5.5 --- .../native-execution-input.test.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/server/src/services/native-runtime/native-execution-input.test.ts b/server/src/services/native-runtime/native-execution-input.test.ts index 6f9644b97ff..5f100f2a11d 100644 --- a/server/src/services/native-runtime/native-execution-input.test.ts +++ b/server/src/services/native-runtime/native-execution-input.test.ts @@ -660,6 +660,25 @@ describe("Cursor mode native execution projection", () => { }); }); +describe("Antigravity swarm native execution projection", () => { + const fixture = (acpxAgent: "antigravity" | "cursor", antigravitySwarm?: boolean) => ({ + companyId: "company-1", runId: "run-1", agentId: "agent-1", + issue: { id: "issue-1", identifier: "SWARM-1", title: "Write two files", description: null, workMode: "standard" }, + taskPrompt: "Write a.txt and b.txt.", + workspace: { id: "workspace-1", cwd: "/workspace", repoUrl: null, repoRef: null, branchName: null }, + normalizedSessionId: null, provider: "acpx" as const, acpxAgent, + model: acpxAgent === "antigravity" ? "gemini-3.8-flash-low" : "exact-cursor-model", acpxPermissionMode: "deny-all" as const, + ...(antigravitySwarm === undefined ? {} : { antigravitySwarm }), + completionContract: { id: "contract-1", sha256: `sha256:${"a".repeat(64)}`, schemaVersion: "paperclip.run-result.v1", contract: { revision: "1", objective: "Write", criteria: [{ id: "output", requirement: "Write" }] } }, + runtimeContext: nativeRuntimeContextFixture(), + }); + it("selects the swarm provider mode only for a trusted Antigravity swarm run", () => { + expect(buildNativeExecutionInput(fixture("antigravity", true)).provider).toMatchObject({ agent: "antigravity", mode: "swarm" }); + expect(buildNativeExecutionInput(fixture("antigravity")).provider).not.toHaveProperty("mode"); + expect(buildNativeExecutionInput(fixture("cursor", true)).provider).toMatchObject({ agent: "cursor", mode: "agent" }); + }); +}); + describe("Pi thinking native execution projection", () => { function fixture(piThinkingLevel?: "off" | "low" | "high" | "max") { return {