Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

Openal0x99(GitHub profile, opens in a new tab)wants to merge 8 commits intomain fromrefs/pull/39450/headopened View on GitHub

Showing 6 changed files with 120 additions and 0 deletions (loading 4).

x
0 of 6 viewed, 6 left
113 additions and 0 deletionsapps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.tsModified
View file
@@ -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";
@@ -2841,6 +2844,116 @@
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 {