Skip to content

Commit f5372d2

Browse files
fix(antigravity): reject unsupported manual compaction (#22217)
Co-authored-by: maria-rcks <[email protected]>
1 parent bd9cc0a commit f5372d2

3 files changed

Lines changed: 48 additions & 1 deletion

File tree

‎apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,49 @@ const layerSession = Layer.mergeAll(
128128
TestProviderHost.layer().pipe(Layer.provide(NodeServices.layer)),
129129
);
130130

131+
describe("AntigravityAdapterV2 compaction", () => {
132+
it.effect("does not expose unsupported manual compaction on the provider session", () =>
133+
Effect.gen(function* () {
134+
const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner;
135+
const path = yield* Path.Path;
136+
const crypto = yield* Crypto.Crypto;
137+
const mockAgentPath = yield* path.fromFileUrl(
138+
new URL("../../../scripts/acp-mock-agent.ts", import.meta.url),
139+
);
140+
const instanceId = ProviderInstanceId.make("antigravity-compaction-test");
141+
const adapter = yield* makeAntigravityAdapterV2({
142+
instanceId,
143+
selfInvocation: yield* resolveSelfInvocation(),
144+
makeRuntime: (input) =>
145+
makeAntigravityAcpRuntime({
146+
...input,
147+
childProcessSpawner,
148+
spawn: {
149+
command: process.execPath,
150+
args: [mockAgentPath],
151+
cwd: input.cwd,
152+
env: { T3_ACP_ANTIGRAVITY: "1" },
153+
},
154+
}).pipe(Effect.provideService(Crypto.Crypto, crypto)),
155+
withProcess: (_stop, task) => task,
156+
// @effect-diagnostics-next-line effectSucceedWithVoid:off - This optional result requires undefined, not the wider void type.
157+
defaultModel: Effect.succeed(undefined),
158+
});
159+
const session = yield* adapter.openSession({
160+
threadId: ThreadId.make("thread-antigravity-compaction"),
161+
providerSessionId: ProviderSessionId.make("provider-session-antigravity-compaction"),
162+
modelSelection: { instanceId, model: "gemini-test-low" },
163+
runtimePolicy: ProviderAdapter.ProviderAdapterV2RuntimePolicy.make({
164+
runtimeMode: "full-access",
165+
interactionMode: "default",
166+
cwd: process.cwd(),
167+
}),
168+
});
169+
assert.isUndefined(session.compactThread);
170+
}).pipe(Effect.provide(layerSession), Effect.scoped),
171+
);
172+
});
173+
131174
describe("AntigravityAdapterV2 session open", () => {
132175
it.effect.each([
133176
{

‎apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ export function makeAntigravityAcpAdapterFlavor(
238238
normalizeToolCall: normalizeAntigravityToolCall,
239239
extractSubagentUpdate: extractAntigravitySubagentUpdate,
240240
supportsImagePrompts: true,
241-
supportsCompaction: true,
241+
// ACP 1.3.0 treats /compact as ordinary model input.
242+
supportsCompaction: false,
242243
requiresSignIn: isAntigravitySignInRequiredError,
243244
};
244245
}

‎docs/user/providers-antigravity.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ T3 Code keeps conversation history and file diffs, but Antigravity cannot rewind
8787
its conversation. Reverting a thread or editing and resubmitting an earlier turn
8888
is unavailable. Continue with a follow-up message or start a new thread.
8989

90+
Manual context compaction is unavailable through Antigravity's ACP runtime, even
91+
though its CLI has `/compact`. Start a new thread when you need a fresh context.
92+
9093
### Skills and attachments
9194

9295
Put project skills in `.agents/skills`. T3 Code also reads `.gemini/skills` and the

0 commit comments

Comments
 (0)