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(server): reconcile canceled Antigravity background commands at turn settlement by al0x99 · Pull Request #39450 · pingdotgg/t3code

fix(server): reconcile canceled Antigravity background commands at turn settlement #39450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
al0x99 wants to merge 8 commits into pingdotgg:main
base: main
Loading
Loading
from al0x99:fix/antigravity-bg-command-reconcile
+1,017 −2
Open

fix(server): reconcile canceled Antigravity background commands at turn settlement #39450

Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit Hold shift + click to select a range
4f21593
fix(server): reconcile canceled Antigravity background commands at tu…
al0x99 Nov 20, 2026
fa1daf1
fix(server): preserve uncertainty for unattributed or ambiguous activ…
al0x99 Nov 20, 2026
50466fa
Merge origin/main and preserve non-execute outliving tools (#39806)
al0x99 Nov 21, 2026
ec66935
fix(server): bound metadata size in SQLite before materializing activ…
al0x99 Nov 21, 2026
f9281b5
test(server): cover oversized metadata guard in AntigravityBackground…
al0x99 Nov 21, 2026
89fe94a
test(server): use valid matching metadata in oversized-metadata guard…
al0x99 Nov 21, 2026
2f691ec
Merge origin/main and align command matching with #40702 and #40858
al0x99 Nov 22, 2026
902703d
Merge remote-tracking branch 'origin/main' into fix/antigravity-bg-co…
al0x99 Nov 26, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

113 changes: 113 additions & 0 deletions 113 apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// @effect-diagnostics nodeBuiltinImport:off -- fixtures write a native session database.
import * as NodeSqlite from "node:sqlite";

import * as NodeCrypto from "@effect/platform-node/NodeCrypto";
import * as NodeServices from "@effect/platform-node/NodeServices";
import { assert, describe, it } from "@effect/vitest";
Expand Down Expand Up @@ -2010,6 +2013,116 @@ describe("AntigravityAdapterV2 work after the prompt ends", () => {
assert.equal(opened.cancels(), cancels);
}).pipe(Effect.provide(layerSession)),
);

// When manage_task(kill) cancels a background run_command, agy transitions its RUN_COMMAND step
// to CANCELED (6) in conversations/<sessionId>.db without emitting a terminal tool_call_update.
it.effect(
"finalizes the turn when a background command was canceled in the session database without a tool_call_update",
() =>
Effect.gen(function* () {
const fileSystem = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
const profile = yield* fileSystem.makeTempDirectoryScoped({ prefix: "t3-agy-cmd-cancel-" });
const conversations = path.join(profile, "antigravity-acp", "conversations");
yield* fileSystem.makeDirectory(conversations, { recursive: true });
const db = new NodeSqlite.DatabaseSync(path.join(conversations, "mock-session-1.db"));
try {
db.exec(
"CREATE TABLE steps (idx INTEGER PRIMARY KEY, step_type INTEGER NOT NULL, status INTEGER NOT NULL, metadata BLOB, step_payload BLOB)",
);
db.prepare("INSERT INTO steps VALUES (14, 21, 6, NULL, NULL)").run();
} finally {
db.close();
}
const { command, startTurn, throughTerminal } = yield* openSessionWithRunningCommand(
{ WaitMsBeforeAsync: 10000 },
undefined,
undefined,
{ profileDirectory: profile },
);
yield* startTurn(1, false);
const run = yield* throughTerminal;
const terminal = run.at(-1);
assert.equal(terminal?.type === "turn.terminal" && terminal.status, "completed");
const reconciled = run.findLast(
(event) =>
event.type === "turn_item.updated" &&
event.turnItem.nativeItemRef?.nativeId === command.toolCallId,
);
assert.equal(
reconciled?.type === "turn_item.updated" && reconciled.turnItem.status,
"failed",
);
}).pipe(Effect.provide(layerSession)),
);

it.effect(
"keeps the run open when the session database confirms the background command is still running",
() =>
Effect.gen(function* () {
const fileSystem = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
const profile = yield* fileSystem.makeTempDirectoryScoped({ prefix: "t3-agy-cmd-live-" });
const conversations = path.join(profile, "antigravity-acp", "conversations");
yield* fileSystem.makeDirectory(conversations, { recursive: true });
const encoder = new TextEncoder();
const varint = (value: number): number[] => {
const bytes: number[] = [];
while (value >= 0x80) {
bytes.push((value & 0x7f) | 0x80);
value = Math.floor(value / 0x80);
}
return [...bytes, value];
};
const field = (number: number, value: string | Uint8Array) => {
const bytes = typeof value === "string" ? encoder.encode(value) : value;
return [...varint(number * 8 + 2), ...varint(bytes.length), ...bytes];
};
const proto = (...parts: number[][]) => Uint8Array.from(parts.flat());
const metadata = proto(
field(
4,
proto(
field(1, "call_native_999"),
field(2, "run_command"),
field(3, JSON.stringify({ CommandLine: "node fetch_throughput.mjs" })),
),
),
);
const db = new NodeSqlite.DatabaseSync(path.join(conversations, "mock-session-1.db"));
try {
db.exec(
"CREATE TABLE steps (idx INTEGER PRIMARY KEY, step_type INTEGER NOT NULL, status INTEGER NOT NULL, metadata BLOB, step_payload BLOB)",
);
db.prepare("INSERT INTO steps VALUES (14, 21, 2, ?, NULL)").run(metadata);
} finally {
db.close();
}
const { command, usage, send, startTurn, until, throughPromptSettled } =
yield* openSessionWithRunningCommand({ WaitMsBeforeAsync: 10000 }, undefined, undefined, {
profileDirectory: profile,
});
yield* startTurn(1, false);
yield* throughPromptSettled;
yield* TestClock.adjust("10 minutes");
yield* send({
sessionUpdate: "tool_call_update",
...command,
status: "completed",
rawOutput: { output: "Command exited with code 0.", exit_code: 0 },
});
yield* send({
sessionUpdate: "agent_message_chunk",
content: { type: "text", text: "Command finished." },
});
yield* send(usage);
yield* TestClock.adjust("3 seconds");
const run = yield* until((event) => event.type === "turn.terminal");
const terminal = run.at(-1);
assert.equal(terminal?.type === "turn.terminal" && terminal.status, "completed");
assert.include(JSON.stringify(run), "Command finished.");
}).pipe(Effect.provide(layerSession)),
);
});

describe("AntigravityAdapterV2 subagent reads", () => {
Expand Down
7 changes: 7 additions & 0 deletions 7 apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
readAntigravityChildrenAtWork,
readAntigravityPendingReply,
} from "../../provider/acp/AntigravityChildWork.ts";
import { readAntigravityRunningCommands } from "../../provider/acp/AntigravityBackgroundCommands.ts";
import { readAntigravityClientTextFile } from "../../provider/acp/AntigravityClientFiles.ts";
import { watchAntigravityPromptOutcome } from "../../provider/acp/AntigravityTurnOutcome.ts";
import {
Expand Down Expand Up @@ -305,6 +306,12 @@ export function makeAntigravityAcpAdapterFlavor(
rootSessionId: sessionId,
toolCallIds: nativeTaskIds,
}),
toolsOutlivingPrompt: ({ sessionId, tools }) =>
readAntigravityRunningCommands({
profileDirectory,
sessionId,
tools,
}),
hasPendingReply: (sessionId: string) =>
readAntigravityPendingReply({
profileDirectory,
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
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.