Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
9d0f095
test(server): Antigravity below 1.5 is broken and 1.5.12 is recommended
juliusmarminge Nov 19, 2026
ed326b0
fix(server): refuse Antigravity runtimes below 1.5
juliusmarminge Nov 19, 2026
213efc9
fix(server): advance model manifest updatedAt so cached policies yiel…
juliusmarminge Nov 19, 2026
cb55378
refactor(server): remove Antigravity code for runtimes below 1.5
juliusmarminge Nov 19, 2026
9f36f48
Merge remote-tracking branch 'origin/main' into factory/issue-38905-a…
juliusmarminge Nov 19, 2026
cdc0443
test(server): port main's Windows EPERM rename test to the CLI asset
juliusmarminge Nov 19, 2026
6ddc65a
fix(server): a prefixed pre-CLI Antigravity version still resolves br…
juliusmarminge Nov 19, 2026
346be89
Merge origin/main into factory/issue-38905-a1795062711
juliusmarminge Nov 19, 2026
296604f
fix(server): an Antigravity prerelease below 1.5 resolves broken
juliusmarminge Nov 19, 2026
b886a2e
Merge origin/main into factory/issue-38905-a1795062711
juliusmarminge Nov 19, 2026
821bf01
fix(server): releases that cannot install the Antigravity CLI keep th…
juliusmarminge Nov 19, 2026
0388ac6
fix(server): use Schema.is for the refused-runtime refresh message
juliusmarminge Nov 19, 2026
4e5f3fd
Merge origin/main into factory/issue-38905-a1795062711
juliusmarminge Nov 19, 2026
9b8326c
Merge origin/main into factory/issue-38905-a1795062711
juliusmarminge Nov 20, 2026
a72c7d7
fix(server): drop the pre-1.5 Antigravity sign-in guards and harness-…
juliusmarminge Nov 20, 2026
98bf193
Merge origin/main into factory/issue-38905-a1795062711
juliusmarminge Nov 20, 2026
6af421c
test(server): drop a stale Antigravity harness fixture line
juliusmarminge Nov 20, 2026
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
28 changes: 1 addition & 27 deletions apps/server/scripts/acp-mock-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand Down Expand Up @@ -522,16 +521,6 @@ const program = Effect.gen(function* () {
},
});

const writeHarnessFailure = Effect.promise(
() =>
new Promise<void>((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,
Expand Down Expand Up @@ -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 = [
[
Expand Down Expand Up @@ -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;
Expand Down
163 changes: 4 additions & 159 deletions apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>();
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<ProviderAdapter.ProviderAdapterV2Event>();
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 },
Expand Down Expand Up @@ -2029,8 +1879,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;
Expand Down Expand Up @@ -2148,13 +1998,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, "<pull_request_linking>");
} else {
assert.notInclude(append, "systemPrompt");
assert.include(sent, "<pull_request_linking>");
}
assert.notInclude(append, "systemPrompt");
assert.include(sent, "<pull_request_linking>");
}).pipe(Effect.provide(layerSession)),
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -222,21 +222,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),
Expand Down Expand Up @@ -297,7 +288,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
Expand Down
Loading
Loading