fix(antigravity): route swarm worker tool calls off the coordinator timeline #46935
Openitsthecsguy(GitHub profile, opens in a new tab)wants to merge 7 commits into
main fromrefs/pull/46935/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
tanstack-source added labelsbug
- @@ -207,3 +238,18 @@207- const update = plans(reads.repair(notification));208- return update === undefined ? Effect.void : updates.withPermit(handler(update));209- });238+ return runtime.handleSessionUpdate((notification) =>239+ Effect.gen(function* () {240+ const inner = notification.update;241+ if (242+ inner.sessionUpdate === "tool_call" ||243+ inner.sessionUpdate === "tool_call_update"244+ ) {245+ if (typeof inner.title === "string" && runtimeTransformTitles.has(inner.title)) {246+ const known =247+ knownChildIdsBySession.get(notification.sessionId) ?? new Set<string>();248+ const child = yield* resolveChildToolCall({249+ sessionId: notification.sessionId,250+ toolCallId: inner.toolCallId,251+ knownChildSessionIds: known,252+ });253+ if (child !== undefined) {254+ rememberChildId(notification.sessionId, child.childSessionId);255+ return yield* updates.withPermit(handler(notification));
juliusmarminge added labelstakeover:in-progress
Pushed0d2e28b
- @@ -7496,10 +7524,4 @@74967524 }74977525 continue;74987526 }7499- yield* projectSubagentTool(7500- subagent,7501- notification.sessionId,7502- toolCall,7503- undefined,7504- context,7505- );7527+ if (flavor.readSubagentTranscript === undefined) {
github-actions[bot](GitHub profile, opens in a new tab) added labelsneeds-rebase
Pushed2919abd
- @@ -6204,0 +6527,21 @@6527+ status: "completed",6528+ locations: [{ path: "/project/worker-turn2.ts" }],6529+ });6530+ yield* send({6531+ sessionUpdate: "tool_call",6532+ toolCallId: `${workerTwoId}:call_helper_edit`,6533+ title: "Edit helper.ts",6534+ kind: "edit",6535+ status: "completed",6536+ locations: [{ path: "/project/helper.ts" }],6537+ });6538+ yield* send({ sessionUpdate: "usage_update", used: 1200, size: 1048576 });6539+ return { stopReason: "end_turn" as const };6540+ }),6541+ });6542+6543+ yield* startTurn(1);6544+ const turn1PromptEvents = yield* until(6545+ (event) =>6546+ event.type === "turn_item.updated" &&6547+ event.turnItem.type === "assistant_message" &&@@ -248,3 +274,18 @@248- const update = plans(reads.repair(notification));249- return update === undefined ? Effect.void : updates.withPermit(handler(update));250- });274+ return runtime.handleSessionUpdate((notification) =>275+ Effect.gen(function* () {276+ const inner = notification.update;277+ if (278+ inner.sessionUpdate === "tool_call" ||279+ inner.sessionUpdate === "tool_call_update"280+ ) {281+ if (inner.title === "Run update_steps") {282+ const known =283+ knownChildIdsBySession.get(notification.sessionId) ?? new Set<string>();284+ const child = yield* resolveChildToolCall({285+ sessionId: notification.sessionId,286+ toolCallId: inner.toolCallId,287+ knownChildSessionIds: known,288+ });289+ if (child !== undefined) {290+ rememberChildId(notification.sessionId, child.childSessionId);291+ return yield* updates.withPermit(handler(reads.repair(notification)));
github-actions[bot](GitHub profile, opens in a new tab) removed labelsneeds-rebase
Pushedf8d1f29
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
The ACP adapter now routes validated, child-prefixed Antigravity tool calls to child sessions. It tracks child tool state for permission handling and adjusts parent and child timeline projection. Tests cover transcript and non-transcript routing, file reads, and permission modes.
Changes: Child tool routing
packages/provider-acp/src/server/adapter.ts,apps/server/src/provider/acp/AntigravityProtocol.ts,apps/server/src/provider/acp/AntigravityChildWork.tsapps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.tspackages/provider-acp/src/server/adapter.ts,apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.tsEstimated code review effort: 4 (Complex) | ~45 minutes
Change: Bug fix
Sequence Diagram(s)#
Possibly related issues
pingdotgg/t3code#45156— The PR routes child-prefixed tool calls to child sessions and keeps them off the parent timeline. It does not address the issue’s Swarm Board, idle-latch, or live-update items.pingdotgg/t3code#41534— The PR tracks child tool state for permission-policy lookups and tests permission handling in full-access and approval-required modes. It does not confirm that the reported timeout is resolved.pingdotgg/t3code#46894— The PR routes Antigravity child-prefixed tool calls to child sessions. The issue describes a non-Swarminvoke_subagentcase, which is outside the stated Antigravity scope.Suggested reviewers:
juliusmarminge,eliblaubalto,loxofyMerge Risk:
Low · previous review
2919aAntigravity worker tool calls are now routed off the coordinator timeline. In one narrow case, without a profile directory and with a swarm launch ACK that omits the action, worker tools can still appear on the coordinator timeline. Child tool rows can also be missing when a transcript reader is configured but returns no rows. These are minor and bounded, so merge risk is low.
Pre-merge checks:
4
Full details: Title check
Explanation
The title "fix(antigravity): route swarm worker tool calls off the coordinator timeline" follows conventional commit form and names the main change. The changeset routes child-prefixed Antigravity swarm worker tool calls to the child session, which keeps them off the parent timeline. The title is specific and concise, and it matches the PR objectives.
Full details: Description check
Explanation
The description follows the template sections: Problem, Change, Scope, and Verification. The Problem section gives the wire-level cause and symptoms. The Change section lists the touched files and the reason for each. The Scope section states the bug-fix boundary and excludes the Swarm Board UI and the idle-to-running reactivation. The Verification section gives focused test commands, before/after results, and a note on what was not checked. The description does not link a specific issue as the bug report, though it cites
#45156and#41534as related. It also does not state the model and harness in the required closing line, although it does name a harness. These are minor gaps.Finishing Touches
Generate unit tests (beta)