fix(antigravity): Show background command summaries and live output #40687
Openmwolson(GitHub profile, opens in a new tab)wants to merge 1 commit into
main fromrefs/pull/40687/headopened View on GitHubtanstack-source added labelsbug
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XL
- @@ -1822,3 +1827,12 @@18221827 for (const entryId of fold.hiddenEntryIds) collapsedEntryIds.add(entryId);18231828 }18241829 }1830+ const tailIsActiveActivityGroup =1831+ activeTailGroup?.type === "activity-group" && activeTailGroup.runId === activeRunId;1832+ const trailingRunningCommands: ThreadFeedActivity[] = [];1833+ const trailingRunningCommandIds = new Set<string>();1834+ if (1835+ !zen &&1836+ isWorking &&1837+ latestRun?.turnEnded !== true &&1838+ !tailIsActiveActivityGroup &&@@ -1930,3 +1960,4 @@19301960 result.push(...rows);19311961 continue;19321962 }1963+ const presentationEntry =@@ -1674,0 +1698,21 @@1698+ commandLine: "python3 capture.py",1699+ toolSummary: "Capture 60 frames if sky is clean",1700+ }),1701+ );1702+ db.close();1703+ const logFile = path.join(tasksDir, "task-17.log");1704+ yield* fileSystem.writeFileString(logFile, "sky median 412 ADU\n");1705+1706+ const cmd = {1707+ toolCallId: "call_bg_capture",1708+ kind: "execute",1709+ title: "Run command",1710+ rawInput: { CommandLine: "python3 capture.py", WaitMsBeforeAsync: 5000 },1711+ } as const;1712+ const { send, startTurn, until, throughPromptSettled } =1713+ yield* openSessionWithRunningCommand({}, undefined, undefined, {1714+ profileDirectory: profile,1715+ initialToolCalls: [{ sessionUpdate: "tool_call", ...cmd, status: "in_progress" }],1716+ });1717+ yield* startTurn(1, false);1718+ yield* throughPromptSettled;@@ -0,0 +1,14 @@1+import * as NodeServices from "@effect/platform-node/NodeServices";2+import { assert, describe, it } from "@effect/vitest";3+import * as Deferred from "effect/Deferred";4+import * as Effect from "effect/Effect";5+import * as Fiber from "effect/Fiber";6+import * as FileSystem from "effect/FileSystem";7+import * as Path from "effect/Path";8+import * as Queue from "effect/Queue";9+10+import { commandStep, makeProfile, ROOT } from "./AntigravityChildWork.testkit.ts";11+import { tailAntigravityCommandOutput } from "./AntigravityTaskOutputTail.ts";12+13+describe("tailAntigravityCommandOutput", () => {14+ it.live("discovers toolSummary and streams task-<idx>.log across split UTF-8 bytes", () =>@@ -1808,6 +1813,6 @@18081813 };18091814 })()18101815 : null;1811- const activeWorkEntryIds = new Set(1812- activeWorkRow !== null || latestToolFailed ? activeToolEntries.map((entry) => entry.id) : [],1813- );1816+ const trailingRunningCommandEntries =1817+ input.isWorking &&1818+ activeWorkRow === null &&@@ -4930,0 +4985,21 @@4985+ !commandOutputTails.has(nativeItemId)4986+ ) {4987+ const stop = yield* Deferred.make<void>();4988+ const tailCommandOutput = flavor.tailCommandOutput;4989+ const tailedToolCallId = toolCall.toolCallId;4990+ const fiber = yield* tailCommandOutput({4991+ sessionId: context.nativeThreadId,4992+ toolCallId: tailedToolCallId,4993+ stop,4994+ onChunk: (chunk) =>4995+ emitProviderEvent({4996+ type: "command_output.delta",4997+ driver,4998+ threadId: context.input.threadId,4999+ itemId: turnItem.id,5000+ chunk,5001+ }),5002+ onTitle: Effect.fnUntraced(function* (nextTitle: string) {5003+ const trimmed = nextTitle.trim();5004+ if (trimmed.length === 0 || context.finalized) return;5005+ context.commandOutputTitles.set(tailedToolCallId, trimmed);
Pusheda9144c9
- @@ -1908,3 +1942,11 @@19081942 continue;19091943 }19101944 if (!collapsedEntryIds.has(entry.id)) {1945+ const filteredEntry =1946+ trailingRunningCommandIds.size > 0 && entry.type === "activity-group"1947+ ? {1948+ ...entry,1949+ activities: entry.activities.filter(1950+ (activity) => !trailingRunningCommandIds.has(activity.id),1951+ ),1952+ }
Pushed2db3719
- @@ -2168,3 +2204,14 @@21682204 if (clientTerminals !== undefined) {21692205 yield* Scope.addFinalizer(sessionScope, clientTerminals.disposeAll);21702206 }2207+ const commandOutputTails = new Map<2208+ string,2209+ {2210+ readonly context: ActiveAcpTurn;2211+ readonly fiber: Fiber.Fiber<void>;2212+ readonly stop: Deferred.Deferred<void>;2213+ }2214+ >();2215+ // Waits for the tail's last read so its output lands before the call settles.2216+ const stopCommandOutputTail = (nativeItemId: string) =>2217+ Effect.suspend(() => {
Pushed3163ada
- @@ -2168,3 +2204,18 @@21682204 if (clientTerminals !== undefined) {21692205 yield* Scope.addFinalizer(sessionScope, clientTerminals.disposeAll);21702206 }2207+ const commandOutputTails = new Map<2208+ string,2209+ {2210+ readonly context: ActiveAcpTurn;2211+ readonly fiber: Fiber.Fiber<void>;2212+ readonly stop: Deferred.Deferred<void>;2213+ }2214+ >();2215+ // Waits for the tail's last read so its output lands before the call settles.2216+ const stopCommandOutputTail = Effect.fn("AcpAdapter.stopCommandOutputTail")(function* (2217+ nativeItemId: string,2218+ ) {2219+ const tail = commandOutputTails.get(nativeItemId);2220+ if (tail === undefined) return;2221+ commandOutputTails.delete(nativeItemId);
Pushed33d82e3
- @@ -2168,3 +2204,19 @@21682204 if (clientTerminals !== undefined) {21692205 yield* Scope.addFinalizer(sessionScope, clientTerminals.disposeAll);21702206 }2207+ const commandOutputTails = new Map<2208+ string,2209+ {2210+ readonly context: ActiveAcpTurn;2211+ readonly fiber: Fiber.Fiber<void>;2212+ readonly stop: Deferred.Deferred<void>;2213+ }2214+ >();2215+ // Waits for the tail's last read so its output lands before the call settles.2216+ const stopCommandOutputTail = Effect.fn("AcpAdapter.stopCommandOutputTail")(function* (2217+ nativeItemId: string,2218+ ) {2219+ const tail = commandOutputTails.get(nativeItemId);2220+ if (tail === undefined) return;2221+ yield* Deferred.succeed(tail.stop, undefined);2222+ yield* Fiber.await(tail.fiber);
Sign in to join this conversation.


Note
Reviews paused#
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
reviews.auto_review.auto_pause_after_reviewed_commitssetting.Use the following commands to manage reviews:
@coderabbitai resumeto resume automatic reviews.@coderabbitai reviewto trigger a single review.Use the checkboxes below for quick actions:
Walkthrough
Antigravity command summaries are normalized and displayed as titles. The ACP adapter tails background command output and emits output deltas. Web and mobile timelines show in-progress commands as live activity after interim assistant messages.
Changes: Background Command Activity
apps/server/src/provider/acp/AntigravityProtocol.ts,packages/client-runtime/src/work-log/presentation.ts,apps/server/src/provider/acp/AntigravityProtocol.test.ts,apps/mobile/src/lib/threadActivity.ts,apps/web/src/components/chat/MessagesTimeline.logic.tspackages/provider-acp/src/server/adapter.ts,apps/server/src/provider/acp/AntigravityTaskOutputTail.ts,apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.ts,apps/server/src/provider/acp/AntigravityChildWork.testkit.ts,apps/server/src/provider/acp/AntigravityTaskOutputTail.test.ts,apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.tsapps/mobile/src/lib/threadActivity.ts,apps/web/src/components/chat/MessagesTimeline.logic.ts,apps/mobile/src/lib/threadActivity.test.ts,apps/web/src/components/chat/MessagesTimeline.active-tools.test.tsEstimated code review effort: 4 (Complex) | ~45 minutes
Change: Bug fix
Sequence Diagram(s)#
Possibly related issues
Suggested labels:
bugfixSuggested reviewers:
juliusmarminge,charlesbine,azygossMerge Risk:
Low · previous review
33d82This change surfaces Antigravity background command titles and live output in the web and mobile timelines. The remaining issues are narrow: command output could be missed in a rare timing case, the task-log path is not re-validated on every read, and the web timeline could briefly emit a duplicate live row ID after a failed tool. They are worth following up but do not block merging.
Pre-merge checks:
4
Full details: Title check
Explanation
The title "fix(antigravity): Show background command summaries and live output" matches the main change. The changeset surfaces toolSummary as the command title and tails the task log to stream live output for background commands, both of which the title names. It is a conventional commit title in plain language, and it is specific enough for a teammate scanning history. The title does not mention the pinning of running commands below interim assistant messages on web and mobile, but it is a secondary aspect of the change and that omission is acceptable.
Full details: Description check
Explanation
The description follows the repository template closely. It has Problem, Change, Scope, and Verification sections, and each contains specific, relevant content. The Problem section explains the observed behavior: a generic command label, empty output while the command runs, and the stranded command above the interim message. The Change section maps each fix to a concrete behavior. The Scope section links issue
#41104and mentions related issue#39820. The Verification section lists commands run, test counts, a revert-based proof, and before/after screenshots. Minor gaps: the Scope section makes a feature-versus-bug argument that needs maintainer triage, and the Verification section does not state clearly which items were not checked beyond mobile screenshots. The description is mostly complete, so the check passes.Finishing Touches
Generate unit tests (beta)