The best way to control Claude Code, Codex and more from any computer or phone
fix(antigravity): a scheduled wake keeps its run open instead of looking finished (#39806)
Julius Marminge committed
Nov 20, 2026 at 08:57 UTC
6edb53026b3127fb5d1dcbd207c096b00e1bf880
3 files changed
+53
-5
apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.ts
+2
-2
@@ -39,7 +39,7 @@ import { readAntigravityClientTextFile } from "../../provider/acp/AntigravityCli
39
import { watchAntigravityPromptOutcome } from "../../provider/acp/AntigravityTurnOutcome.ts";
40
import {
41
antigravityApprovalOptions,
42
- antigravityCommandOutlivesPrompt,
42
+ antigravityToolOutlivesPrompt,
43
antigravitySubagentOutput,
44
classifyAntigravitySubagentToolCall,
45
extractAntigravityUserInputQuestion,
@@ -242,7 +242,7 @@ export function makeAntigravityAcpAdapterFlavor(
242
deferFinalizeForBackgroundWork: true,
243
wakeOnDetachedRequest: true,
244
replyEndsWithUsageUpdate: true,
245
- toolOutlivesPrompt: antigravityCommandOutlivesPrompt,
245
+ toolOutlivesPrompt: antigravityToolOutlivesPrompt,
246
// session/cancel ends the agent's running commands, so only Stop sends it once the prompt
247
// has ended. A message sent while a command runs leaves the command alone.
248
preserveRuntimeOnSettledInterrupt: true,
apps/server/src/provider/acp/AntigravityProtocol.test.ts
+44
@@ -7,6 +7,7 @@ import {
7
extractAntigravityUserInputQuestion,
8
antigravityApprovalOptions,
9
antigravitySubagentOutput,
10
+ antigravityToolOutlivesPrompt,
11
classifyAntigravitySubagentToolCall,
12
isAntigravityUserInputRequest,
13
makeAntigravityUserInputResponse,
@@ -491,6 +492,49 @@ describe("Antigravity tool results", () => {
492
expect(JSON.stringify(event.rawPayload)).not.toContain("formatted_output");
493
});
494
495
+ it.each([
496
+ { name: "a command", update: commandStarted.update, outlives: true },
497
+ {
498
+ name: "a daemon",
499
+ update: { ...commandStarted.update, rawInput: { CommandLine: "serve", IsDaemon: true } },
500
+ outlives: false,
501
+ },
502
+ // agy 1.5.13 keeps this call in progress until the wake fires.
503
+ {
504
+ name: "a scheduled wake",
505
+ update: {
506
+ sessionUpdate: "tool_call",
507
+ toolCallId: "call_4902666363527503248",
508
+ status: "in_progress",
509
+ kind: "other",
510
+ title: "Run schedule",
511
+ rawInput: { DurationSeconds: 30, Prompt: "Reply only with the word DONE." },
512
+ },
513
+ outlives: true,
514
+ },
515
+ {
516
+ name: "another native tool",
517
+ update: {
518
+ sessionUpdate: "tool_call",
519
+ toolCallId: "call_other",
520
+ status: "in_progress",
521
+ kind: "other",
522
+ title: "Run list_dir",
523
+ rawInput: { DirectoryPath: "/workspace" },
524
+ },
525
+ outlives: false,
526
+ },
527
+ ] satisfies ReadonlyArray<{
528
+ name: string;
529
+ update: EffectAcpSchema.SessionNotification["update"];
530
+ outlives: boolean;
531
+ }>)("knows whether $name outlives the prompt", ({ update, outlives }) => {
532
+ const event = parseToolUpdate({ sessionId: "session-1", update });
533
+ expect(antigravityToolOutlivesPrompt(normalizeAntigravityToolCall(event.toolCall))).toBe(
534
+ outlives,
535
+ );
536
+ });
537
+
538
it("keeps 1.5 command input and output valid Unicode when cut", () => {
539
const tail = `${"x".repeat(7_982)}build completed\r\n`;
540
const output = `Command output:\nprefix\r\n🚀${tail}`;
apps/server/src/provider/acp/AntigravityProtocol.ts
+7
-3
@@ -45,11 +45,15 @@ const decodeSingleAnswer = Schema.decodeUnknownOption(
45
);
46
const decodeToolCallContent = Schema.decodeUnknownOption(AcpWireSchema.ToolCallContent);
47
48
+// agy keeps its own `schedule` call in progress until the wake fires, then replies by itself.
49
+const ANTIGRAVITY_SCHEDULE_TITLES = new Set(["Run schedule", "Running schedule"]);
50
+
51
/**
49
- * The agent goes on running a command after its prompt ends, and replies by itself when the
50
- * command finishes. A daemon may never finish.
52
+ * The agent goes on running a command or a scheduled wake after its prompt ends, and replies by
53
+ * itself when it finishes. A daemon may never finish.
54
*/
52
-export function antigravityCommandOutlivesPrompt(toolCall: AcpToolCallState): boolean {
55
+export function antigravityToolOutlivesPrompt(toolCall: AcpToolCallState): boolean {
56
+ if (toolCall.title !== undefined && ANTIGRAVITY_SCHEDULE_TITLES.has(toolCall.title)) return true;
57
const input = toolCall.data.rawInput;
58
return toolCall.kind === "execute" && !(Predicate.isObject(input) && input.IsDaemon === true);
59
}