fix(server): keep Antigravity child tool calls out of the parent's reply #46915
When a native Antigravity background subagent ran, agy forwarded the child's tool calls onto the parent session. T3 treated them as the parent's own tools, so they appeared as cards in the parent's timeline and split the parent's streaming reply in two, often mid-word, and the split was saved in history. The Antigravity adapter now drops these forwarded calls (tool call IDs prefixed <childConversationId>:) before they reach the parent's timeline. The child's work still appears in the subagent's own thread.
Fixes pingdotgg/t3code#46894
Reproduction on main#
Commit b4fd7ba418 (origin/main). Web dev server started with T3CODE_DEV_SEED=0 and GOOGLE_GEMINI_BASE_URL pointed at the hub, on a fresh database. Added an Antigravity instance through Settings → Providers → Add provider, with sign-in method "Gemini API key" and a placeholder key. It showed agy v1.5.21, authenticated, 8 models. Added a scratch git project with 12 plain-text note files and opened a thread on Gemini 4 Neon (Low, Full access).
Turn 1 asked the parent to call invoke_subagent with TypeName="research" in the background. The child was told to read each note and run wc -w on it. The parent replied "launched" and a "Note Files Researcher" subagent appeared in Lineage. While the child was still working, I sent a follow-up asking for a five-paragraph lighthouse essay with bold headings and no tool calls.
What I saw: the parent's streamed reply was cut in the middle of a word. It read "...vital trade routes still demanded reliable navigational aids. Mon", then a child card "wc -w /tmp/.../note03.txt", then a new message starting "astic orders and coastal guilds...". More child "Running wc" cards kept landing in the parent timeline after the essay. Child cards had also appeared under the first turn ("Ran 2 commands").
The split is stored, not just drawn. In orchestration_v2_projection_turn_items for the parent's run, ordinal 1000009 is assistant_message "**The Ancient Pharos...", 1000010 is command_execution, and 1000011 is assistant_message "astic orders...". All three carry the parent's run ID and have no subagent link. The leaked item's native ID is <rootSession 53e71586…>:tool:<childConversation 7d0d0257…>:call_9495233002226623095. That ID is built as ${context.nativeThreadId}:tool:${toolCallId} (packages/provider-acp/src/server/adapter.ts ~5875), on the root-session path. This answers the question the reporter left open: agy sends the child's tool update on the root session, already prefixed <childConversationId>: in its toolCallId, and T3 treats it as one of the parent's own tool calls.
Failing test pushed as factory/repro-46894 (1527ba4371), in apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts. On main it fails with the reply split into ["Medieval Beacons\nMon", "astic orders kept braziers lit. ..."]. The test expects one reply and no child-prefixed tool item on the parent.
Related: open contributor PR #46160 (vitalikish, unmerged) targets this exact behaviour. #45156 point 3 describes the same leak mechanism inside a /swarm bundle. Neither is fixed on main.
Evidence#
Being captured: before and after in the real app. This section is filled in before the pull request can merge.
Tests#
vp test run src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts -t "forwarded child tool calls"(before the fix): failed, reproducing the split replyvp test run src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts src/provider/acp/AntigravityProtocol.test.ts: 106/106 passedvp test run src/provider/acp/AntigravityProtocol.test.ts(with the new predicate test): 54/54 passedvp run check:changed: format, lint, knip, graphql, typecheck (3 packages) and tests (3 files, 109) all pass
Not in this change#
- Not reproduced live against agy through the hub; the failing adapter test from factory/repro-46894 stood in for the live reproduction.
- #45156 (/swarm bundle) may need other changes beyond this leak; only the forwarded child tool-call leak is addressed here.
- Existing parent histories that already stored split replies and child cards are not repaired.
Who did the work#
- Written by Claude Opus 5.5, in Claude Code
- Reviewed by GPT-6.1 Sol, in Codex, and by Claude Opus 5.5, each on its own
- Proof captured by GPT-6.1 Sol and checked by Claude Opus 5.5
Run by the t3code factory in T3 Code.
- 1
tanstack-source added labelsbug
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- @@ -1057,3 +1058,14 @@10571058 expect(foreignCall.data.rawInput).toEqual({ message: "Hello", toolSummary: "Send greeting" });10581059 });10591060 });1061+1062+describe("Antigravity forwarded child tool calls", () => {1063+ const root = "11111111-2222-4333-8444-555555555555";1064+ const child = "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee";1065+ const toolCall = (toolCallId: string): EffectAcpSchema.SessionNotification => ({1066+ sessionId: root,1067+ update: { sessionUpdate: "tool_call", toolCallId, title: "wc -w", kind: "execute" },1068+ });1069+1070+ it("recognizes only calls named by another conversation", () => {1071+ expect(isAntigravityForwardedChildToolUpdate(toolCall(`${child}:call_1`))).toBe(true);
acp/AntigravityProtocol.test.ts:1071This repeats the forwarded-child case already exercised by the adapter regression test. Could you remove this assertion and keep that case at the adapter layer, where it also verifies the reply stays intact?
No longer relevant as of e2d59974e0a5982bcdd99f7d5da5aa180a28ced5
No actionable comments were generated in the recent review.
Walkthrough
-
The Antigravity protocol now detects forwarded child tool updates. The adapter filters these updates from parent-session processing after read repair. Tests cover detection and verify that child tool calls do not split a streaming parent reply or create parent timeline items.
Changes: Forwarded child tool update filtering
Layer / File(s) Summary Detect forwarded child tool updates
apps/server/src/provider/acp/AntigravityProtocol.ts,apps/server/src/provider/acp/AntigravityProtocol.test.tsA new helper identifies tool-call updates whose UUID-shaped conversation prefix differs from the notification session ID. Tests cover matching and rejected prefixes. Filter updates in the adapter
apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.ts,apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.tsThe adapter applies read repair before filtering forwarded child tool updates. The regression test checks that child tool calls do not split the parent reply or create parent timeline items. Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Possibly related issues
pingdotgg/t3code#31297: The PR filters child-prefixed tool calls from the parent timeline. It does not address the separate child-view lookup issue described in this issue.
Suggested reviewers:
eliblaubalto,matthewcosier
Merge Risk:
Minimal · up toe2d59-
The change keeps forwarded background-subagent tool calls out of the parent timeline so parent replies stream without interruption. The remaining uncertainty is that live agy behavior was not reproduced, but nothing indicates a concrete defect, and the change is low risk to merge.
Pre-merge checks:
4-
Check name Status Explanation Title check The title names the primary change: Antigravity child tool calls are kept out of the parent's reply. It matches the summarized adapter and protocol changes, which filter forwarded child tool updates f… Description check The description follows the template's main sections. Problem explains the leak of child tool calls into the parent timeline and the split reply. Change describes the adapter filter on the child ID pr… Linked Issues check [ #46894] The issue requires that the parent reply stream without splits, and that child tool activity appear only in the subagent's own activity. At head e2d5997,makeAntigravityAcpAdapterFlavorin …Out of Scope Changes check The changed code at head ties to the forwarded child tool-call leak in #46894. The changes are: the new predicateisAntigravityForwardedChildToolUpdatein AntigravityProtocol.ts; its wiring in Antig…Full details: Title check
-
Explanation
The title names the primary change: Antigravity child tool calls are kept out of the parent's reply. It matches the summarized adapter and protocol changes, which filter forwarded child tool updates from the parent session. The title follows the conventional commit form and is specific enough for a teammate to scan.
Full details: Description check
-
Explanation
The description follows the template's main sections. Problem explains the leak of child tool calls into the parent timeline and the split reply. Change describes the adapter filter on the child ID prefix. Scope links issue
#46894. Verification lists focused test commands with results and states what was not checked. The Evidence section says it is still pending, which is a gap for a UI-visible bug. The 'Who did the work' attribution is included as the template requests. The description is mostly complete, so the check passes. Minor gap: the Evidence section is unfilled and the 'Scope' section does not explain why the fix needs no issue beyond the linked one.
Full details: Linked Issues check
-
Explanation
[
#46894] The issue requires that the parent reply stream without splits, and that child tool activity appear only in the subagent's own activity. At head e2d5997,makeAntigravityAcpAdapterFlavorin apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.ts wraps the session-update handler. It runsreads.repair(notification)first. It then returns early whenisAntigravityForwardedChildToolUpdate(repaired)is true, so forwarded child tool updates never reach the parent projection. The same predicate also filters the read-repair completion path throughprojectUpdate. Read repair still sees child updates, so child file-read pairing is preserved. The predicate is imported from apps/server/src/provider/acp/AntigravityProtocol.ts. Its body was not re-read at this head in this review. The previous review read it at f120fdd, and the change summary describes the same tool_call and tool_call_update behavior. The new adapter regression test and predicate tests were not independently read; the PR reports them passing. Limits: the live agy reproduction was not performed. The whole-PR adapter diff could not be read through the diff operation, so the verdict relies on head file contents and the change summary.
Full details: Out of Scope Changes check
-
Explanation
The changed code at head ties to the forwarded child tool-call leak in
#46894. The changes are: the new predicateisAntigravityForwardedChildToolUpdatein AntigravityProtocol.ts; its wiring in AntigravityAdapterV2.ts on the projection path and the read-repair completion path; and the regression test in AntigravityAdapterV2.test.ts and predicate tests in AntigravityProtocol.test.ts. The PR description lists existing stored histories and the#45156/swarm bundle as excluded. These are declared exclusions, not out-of-scope changes. The whole-PR diff could not be read through the diff operation, so this verdict relies on head file contents and the change summary.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: factory/issue-46894
- File: .coderabbit.config.ts
- Commit: e2d5997
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Team
- Run ID:
7c8a59b0-ad84-4ac4-a3e9-3f995a3267e7
Commits-
Reviewing files that changed from the base of the PR and between f120fdd36b1d25f5b47f0351b38b197cb9a432c3 and e2d59974e0a5982bcdd99f7d5da5aa180a28ced5.
Files selected for processing: 1-
apps/server/src/provider/acp/AntigravityProtocol.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
-
-
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
Approvability#
Verdict: Approved at
e2d5997Macroscope's review found this PR approvable — Antigravity child tool updates are filtered out of parent replies while read-repair processing remains intact. The change is limited to transcript projection, with no material execution or access-policy impact.
Notes:
- No code objects were reviewed. Approvability was decided on eligibility alone.
- 2
Pushede2d5997
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
The automated pipeline stopped on this pull request and will not merge it:
the capture step could not show the problem on the base commit, so there is nothing to prove fixed.
Created the same scratch git project with 12 synthetic note files. Added Antigravity through Settings → Providers → Add provider, Gemini API key with a placeholder, then Connect; both reported authenticated and 8 models. On head, sent the background invoke_subagent research prompt, observed Note Files Researcher and 'launched', then sent the five-paragraph lighthouse essay prompt using Steer while the child was running. The child read note01.txt, but no wc command or essay followed; the parent displayed HTTP 503 auth_unavailable with upstream 404. On base, added the same project with the real CLI and started a thread with the identical first prompt and model; opened it in the web app. It failed with the same HTTP 503 before launching a child, so the follow-up condition could not be reached. Captures show the provider blocker, not proof of the reported bug or its absence.
It stays open for a person to finish or close.
Sign in to join this conversation.
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Other scenarios#
All 64 scenario measurements match
main.All 64 scenario measurements
short turn resumeWebSocket decodedshort turn resumeWebSocket messageslong turn running, cold openHTTP decodedlong turn running, cold openrowslong turn running, history pageHTTP decodedlong turn running, history pagerowslong turn finished, cold openHTTP decodedlong turn finished, cold openrowslong turn finished, socket cold openWebSocket decodedlong turn finished, socket cold openWebSocket messageslong turn finished, socket cold openrowslong turn finished, work pageHTTP decodedlong turn finished, work pagerowsidle thread resumeWebSocket decodedidle thread resumeWebSocket messagesfleet shell snapshotHTTP decodedfleet shell snapshotrowsfleet shell subscribeWebSocket decodedfleet shell subscribeWebSocket messagesfleet shell resume checkHTTP decodedfleet shell resume checkrowsstale shell reloadHTTP decodedstale shell reloadrowsstale shell resumeWebSocket decodedstale shell resumeWebSocket messagesstale todo list cold openHTTP decodedstale todo list cold openrowsstale todo list cold opennodesstale todo list cold opensubagentsstale todo list cold openplansstale todo list cold openproviderTurnsstale todo list cold opencheckpointsshort turn resumeWebSocket decodedshort turn resumeWebSocket messageslong turn running, cold openHTTP decodedlong turn running, cold openrowslong turn running, history pageHTTP decodedlong turn running, history pagerowslong turn finished, cold openHTTP decodedlong turn finished, cold openrowslong turn finished, socket cold openWebSocket decodedlong turn finished, socket cold openWebSocket messageslong turn finished, socket cold openrowslong turn finished, work pageHTTP decodedlong turn finished, work pagerowsidle thread resumeWebSocket decodedidle thread resumeWebSocket messagesfleet shell snapshotHTTP decodedfleet shell snapshotrowsfleet shell subscribeWebSocket decodedfleet shell subscribeWebSocket messagesfleet shell resume checkHTTP decodedfleet shell resume checkrowsstale shell reloadHTTP decodedstale shell reloadrowsstale shell resumeWebSocket decodedstale shell resumeWebSocket messagesstale todo list cold openHTTP decodedstale todo list cold openrowsstale todo list cold opennodesstale todo list cold opensubagentsstale todo list cold openplansstale todo list cold openproviderTurnsstale todo list cold opencheckpointsBaseline:
fc6ba3d· PR result:e2d5997· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.