GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(antigravity): allow compaction when the runtime advertises it (#3… · nullStack65/t3code@cdf5a6c

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/server/src/orchestration-v2/Adapters
    • AntigravityAdapterV2.test.ts
    • AntigravityAdapterV2.ts
  • docs/user
    • providers-antigravity.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts
+68-13Lines changed: 68 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -317,16 +317,23 @@ describe("AntigravityAdapterV2 harness recovery", () => {
317317
});
318318

319319
describe("AntigravityAdapterV2 compaction", () => {
320-
it.live.each([false, true])(
321-
"negotiates native goals (%s) without enabling manual compaction",
322-
(nativeGoals) =>
320+
it.live.each([
321+
{ nativeGoals: false, compact: false },
322+
{ nativeGoals: true, compact: false },
323+
{ nativeGoals: false, compact: true },
324+
])(
325+
"negotiates native goals ($nativeGoals) and advertised compaction ($compact)",
326+
({ nativeGoals, compact }) =>
323327
Effect.gen(function* () {
324328
const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner;
329+
const fileSystem = yield* FileSystem.FileSystem;
325330
const path = yield* Path.Path;
326331
const crypto = yield* SecureRandom.SecureRandom;
327332
const mockAgentPath = yield* path.fromFileUrl(
328333
new URL("../../../scripts/acp-mock-agent.ts", import.meta.url),
329334
);
335+
const logs = yield* fileSystem.makeTempDirectoryScoped({ prefix: "t3-ag-compact-" });
336+
const requestLog = path.join(logs, "requests.ndjson");
330337
const instanceId = ProviderInstanceId.make("antigravity-compaction-test");
331338
const goalSupport = yield* Ref.make(false);
332339
const startupMilestone = yield* Deferred.make<void>();
@@ -346,7 +353,11 @@ describe("AntigravityAdapterV2 compaction", () => {
346353
command: process.execPath,
347354
args: [mockAgentPath],
348355
cwd: input.cwd,
349-
env: { T3_ACP_ANTIGRAVITY: "1" },
356+
env: {
357+
T3_ACP_ANTIGRAVITY: "1",
358+
T3_ACP_AVAILABLE_COMMANDS: compact ? "compact" : "",
359+
T3_ACP_REQUEST_LOG_PATH: requestLog,
360+
},
350361
},
351362
}).pipe(
352363
Effect.provideService(SecureRandom.SecureRandom, crypto),
@@ -375,28 +386,72 @@ describe("AntigravityAdapterV2 compaction", () => {
375386
)
376387
: Effect.void,
377388
});
389+
const threadId = ThreadId.make("thread-antigravity-compaction");
390+
const modelSelection = { instanceId, model: "gemini-test-low" } as const;
391+
const runtimePolicy = ProviderAdapter.ProviderAdapterV2RuntimePolicy.make({
392+
runtimeMode: "full-access",
393+
interactionMode: "default",
394+
cwd: process.cwd(),
395+
});
378396
const opening = yield* adapter
379397
.openSession({
380-
threadId: ThreadId.make("thread-antigravity-compaction"),
398+
threadId,
381399
providerSessionId: ProviderSessionId.make("provider-session-antigravity-compaction"),
382-
modelSelection: { instanceId, model: "gemini-test-low" },
383-
runtimePolicy: ProviderAdapter.ProviderAdapterV2RuntimePolicy.make({
384-
runtimeMode: "full-access",
385-
interactionMode: "default",
386-
cwd: process.cwd(),
387-
}),
400+
modelSelection,
401+
runtimePolicy,
388402
})
389403
.pipe(Effect.forkScoped);
390404
yield* Deferred.await(startupMilestone);
391405
yield* Deferred.succeed(consumeStartupCommands, undefined);
392406
const session = yield* Fiber.join(opening);
393407
assert.deepEqual(yield* Ref.get(workspaceCommands), {
394-
names: ["plan", "logout"],
408+
names: compact ? ["compact"] : ["plan", "logout"],
395409
cwd: process.cwd(),
396410
});
397-
assert.isUndefined(session.compactThread);
411+
const compactThread = session.compactThread;
412+
assert.isDefined(compactThread);
398413
assert.equal(session.providerSession.capabilities.turns.supportsNativeGoals, nativeGoals);
399414
assert.equal((yield* adapter.getCapabilities()).turns.supportsNativeGoals, nativeGoals);
415+
const providerThread = yield* session.ensureThread({
416+
threadId,
417+
modelSelection,
418+
runtimePolicy,
419+
});
420+
const turnInput = makeTurnInput({
421+
threadId,
422+
providerThread,
423+
instanceId,
424+
modelSelection,
425+
runtimePolicy,
426+
now: yield* DateTime.now,
427+
messageText: "Compact the conversation.",
428+
});
429+
if (compact) {
430+
yield* compactThread!(turnInput);
431+
const events = yield* session.events.pipe(
432+
Stream.takeUntil((event) => event.type === "turn.terminal"),
433+
Stream.runCollect,
434+
);
435+
assert.isTrue(
436+
events.some(
437+
(event) =>
438+
event.type === "turn_item.updated" &&
439+
event.turnItem.type === "compaction" &&
440+
event.turnItem.status === "completed",
441+
),
442+
);
443+
} else {
444+
const error = yield* compactThread!(turnInput).pipe(Effect.flip);
445+
assert.instanceOf(error, ProviderAdapter.ProviderAdapterTurnStartError);
446+
assert.instanceOf(error.cause, ProviderAdapter.ProviderCompactionUnsupportedError);
447+
}
448+
const prompts = (yield* fileSystem.readFileString(requestLog))
449+
.trim()
450+
.split("\n")
451+
.map((line) => JSON.parse(line) as { method?: string; params?: { prompt?: unknown } })
452+
.filter((request) => request.method === "session/prompt")
453+
.map((request) => request.params?.prompt);
454+
assert.deepEqual(prompts, compact ? [[{ type: "text", text: "/compact" }]] : []);
400455
}).pipe(Effect.provide(layerSession)),
401456
);
402457
});
Collapse file

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

Copy file name to clipboardExpand all lines: apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.ts
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,7 @@ export function makeAntigravityAcpAdapterFlavor(
294294
normalizeToolCall: normalizeAntigravityToolCall,
295295
extractSubagentUpdate: extractAntigravitySubagentUpdate,
296296
supportsImagePrompts: true,
297-
// ACP 1.3.0 treats /compact as ordinary model input.
298-
supportsCompaction: false,
297+
compactViaAdvertisedCommand: true,
299298
requiresSignIn: isAntigravitySignInRequiredError,
300299
// Antigravity can leave a prompt open without updates; long tools and approvals pause this.
301300
promptInactivityTimeout: "15 minutes",
Collapse file

‎docs/user/providers-antigravity.md‎

Copy file name to clipboardExpand all lines: docs/user/providers-antigravity.md
+3-2Lines changed: 3 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ Antigravity. Antigravity cannot rewind its own conversation, so the next turn
9898
starts a fresh Antigravity session and T3 Code sends it the kept conversation,
9999
without the turns you removed.
100100

101-
Manual context compaction is unavailable through Antigravity's ACP runtime, even
102-
though its CLI has `/compact`. Send `/clear` when you need a fresh context.
101+
Use `/compact` to summarize a long conversation when your Antigravity runtime
102+
offers that command. If it is unavailable, update Antigravity in provider settings
103+
or send `/clear` when you need a fresh context.
103104

104105
### Skills and attachments
105106

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.