fix(acp): finish delayed history replay before sessions become ready

Keep delayed load updates on the history side of the readiness boundary. Reuse the ACP catalog and configuration mapping to translate legacy Antigravity selections and document the approval requirements for scheduled runs.
This commit is contained in:
Mohamed Boudra
2026-11-19 06:45:24 +01:00
parent 41198e6a2c
commit bbed041d64
8 changed files with 131 additions and 54 deletions
@@ -47,7 +47,7 @@ it.each([true, false])(
const { createInterface } = require("node:readline");
const configOptions = [
{ id: "model", name: "Model", category: "model", type: "select", currentValue: "gemini-4-neon",
options: [{ value: "gemini-4-neon", name: "Gemini 4 Neon" }, { value: "gemini-3.8-flash", name: "Gemini 3.8 Flash" }] },
options: [{ value: "gemini-4-neon", name: "Gemini 4 Neon" }, { value: "gemini-3.8-flash", name: "Gemini 3.8 Flash" }, { value: "gemini-4-neon-high", name: "Gemini 4 Neon High" }] },
{ id: "thought_level", name: "Thinking", category: "thought_level", type: "select", currentValue: "low",
options: [{ value: "low", name: "Low" }, { value: "high", name: "High" }] },
{ id: "mode", name: "Mode", category: "mode", type: "select", currentValue: "accept-edits",
@@ -151,6 +151,20 @@ it.each([true, false])(
}),
}),
);
await connection.send({
type: "session.configure",
requestId: "native-model",
sessionId: "test",
changes: { model: "gemini-4-neon-high" },
});
await expect
.poll(() =>
events.find(
(event) =>
event.type === "session.config" && event.config.model === "gemini-4-neon-high",
),
)
.toBeDefined();
const requests = (await readFile(launch.env.CAPTURE, "utf8"))
.trim()
.split("\n")
@@ -42,18 +42,27 @@ const antigravity: AcpTransformer = {
: undefined,
};
},
async configure(change, { config }) {
async configure(change, { apply, catalog }) {
// COMPAT(antigravityStreamJson): added in v0.16.2, remove after 2027-11-19.
if (change.target === "mode" && change.value === "full-access") {
await config.set("mode", "default");
await apply({ target: "mode", value: "default" });
return "handled";
}
if (change.target === "model" && change.value) {
const legacyModel = /^(.*)-(xhigh|high|medium|low|minimal)$/.exec(change.value);
if (legacyModel) {
await config.set("model", legacyModel[1]);
await config.set("thought_level", legacyModel[2]);
return "handled";
const { models } = catalog();
const [, model, effort] = legacyModel;
if (
!models.some((option) => option.id === change.value) &&
models.some((option) => option.id === model)
) {
await apply({ target: "model", value: model });
if (catalog().thinkingOptions?.some((option) => option.id === effort)) {
await apply({ target: "thinking", value: effort });
}
return "handled";
}
}
}
return "pass";
@@ -67,7 +76,7 @@ export function createAntigravityProvider(): ProviderRegistration {
description: "Antigravity CLI on your host",
icon: "icon.svg",
command: ["agy", "acp", "--disable-telemetry"],
acpOptions: { waitForInitialCommands: true },
acpOptions: { waitForInitialCommands: true, loadReplayQuietPeriodMs: 200 },
transformers: [antigravity],
});
return {
@@ -86,7 +95,7 @@ export function createAntigravityProvider(): ProviderRegistration {
return {
available: false,
diagnostic:
"Antigravity ACP did not start. Install Antigravity 1.5.0 or later and check your CLI configuration.",
"Antigravity ACP did not start. Install Antigravity 1.5.0 or later. If you override the command, include the acp subcommand.",
};
}
},