Problem#
After #38966 restored subagent cards and turn keepalive for agy 1.5.x invoke_subagent calls, opening the Subagent work dialog/sheet on any agy 1.5 subagent still shows:
The provider has no record of which subagents this call started.
Verified against real agy 1.5.12 (agy acp, Google OAuth oauth-personal): conversations/<sessionId>.db records invoke_subagent as step_type = 132 (GENERIC) rather than the legacy step_type = 127 (INVOKE_SUBAGENT) batch step that findInvokeRecord scans, so readAntigravityChildWork always returns []. Meanwhile, agy 1.5 persists detached children under antigravity-acp/brain/<rootSessionId>/.system_generated/subagents/<childId>.json, records the parent's launching invoke_subagent call in antigravity-acp/brain/<childId>/.system_generated/messages/<msgId>.json (sourceMetadata.tool.toolCall.id), and streams steps to antigravity-acp/brain/<childId>/.system_generated/logs/transcript.jsonl in the same JSONL format transcriptSteps already decodes.
Change#
Server-only fix in apps/server/src/provider/acp/AntigravityChildWork.ts (automatically covers web, desktop, and mobile through the existing orchestration.getNativeChildWork RPC):
- Share
listDetachedChildIds and detachedLaunchCall between readAntigravityChildrenAtWork and a new findDetachedInvokeRecord helper.
- Extend
decodeChildMessage with optional content, sourceMetadata.tool.conversationId, and sourceMetadata.tool.toolCall.argumentsJson, and validate subagents/<childId>.json via decodeDetachedSubagent + antigravityManagedPath (no symlinks, size ≤ MAX_STEP_BYTES, conversationId matches filename).
- In
readAntigravityChildWork, resolve a detached agy 1.5 child by exact unique invoke_subagent toolCall.id === nativeTaskId first (decoding full role/prompt from argumentsJson via antigravitySubagentLaunches, falling back to subagentDescriptor.role + message.content), and read transcript.jsonl via antigravityManagedPath + O_NOFOLLOW.
- Preserve fail-closed behavior and existing bounds (
MAX_DETACHED_CHILDREN = 64, MAX_MESSAGE_FILES = 256, MAX_STEP_BYTES = 1 MiB, no new regexes): duplicate toolCall.id claims, unreadable/oversized sibling inboxes, symlinks, or mismatched session/child IDs return [].
- Fall back to the existing SQLite
step_type = 127 + logUri path when no detached record matches, keeping legacy 1.4.x sessions unchanged.
Scope#
Focused bug fix for the follow-up gap explicitly left out of #38966 ("The child transcript view for agy 1.5 launches: the native child reader (findInvokeRecord) matches the legacy batch record, so opening a 1.5 subagent card probably shows no child steps. Not checked and not changed."), related to #38478.
Empirical feedback on #38966 (real agy 1.5.12 + Google OAuth)#
Since #38966 noted that Google sign-in, live end-to-end T3 app verification, and default-mode permission prompts were not checked live, I also verified those against real agy 1.5.12 (oauth-personal) on an isolated T3 server:
- End-to-end keepalive (#38966): Confirmed working with Google OAuth. Running
t3 thread start --provider antigravity --model gemini-3.8-flash --wait held Run 1 open across the detached subagent's 11 s execution (startedAt → completedAt) until the child reported and the parent replied with the result in the same run (no premature completion or extra continuation run).
- Default-mode permission prompt
toolCallId ("Known limits" in #38966): On agy 1.5.12 in default mode (matching antigravityCliSessionMode), invoke_subagent (TypeName: "research" and "self") is auto-approved as title: "Run invoke_subagent" with toolCallId: "call_<digits>", and tools that do send session/request_permission (verified with run_command) keep the exact same call_<digits> ID rather than generating a random 32-hex ID. No adapter.ts change is needed for this.
Verification#
- Before/after on real
agy 1.5.12 captures (isolated /tmp profiles, Google OAuth, gemini-3.8-flash):
- Before fix:
readAntigravityChildWork returned [] on a real 2-child parallel capture (a8804cf0-..., one child finished and one mid-flight).
- After fix: returned the finished child's
conversationId, role, prompt, and 5 decoded transcript steps, and the mid-flight child's live run_command step.
- Live end-to-end against isolated built T3 server (
node apps/server/dist/bin.mjs serve --base-dir /tmp/t3code-dev-38478 --port 38478 --host 127.0.0.1 --no-browser):
- Ran
t3 thread start --provider antigravity --model gemini-3.8-flash --wait to launch subagent Readme E2E.
- Called live WebSocket RPC
orchestration.getNativeChildWork({ threadId: "thread:subagent:888708d66a43aa97" }) → returned _tag: "Success" with conversationId: "934365e8-7cbb-49e7-81fc-92e6c8562b4f", role: "Readme E2E", full prompt, and all 5 decoded transcript.jsonl steps (read_file, file output, send_message, send confirmation, final reply) with the step-0 launch envelope stripped.
- Unit tests (failing test first):
- Added 2 tests in
apps/server/src/provider/acp/AntigravityChildWork.test.ts covering detached 1.5 resolution, descriptor/content fallback, missing transcript (steps: null), send_message filtering, duplicate ID rejection, symlink refusal, mismatched IDs, and corrupt sibling inboxes.
- Failed before the fix (
2 failed | 10 passed) and passed after (12 passed).
- Checks on rebased branch (
43b37b6d3c + 1 commit):
vp run check:changed (2 files since 43b37b6d3c0a): format, lint (0 warnings / 0 errors), knip 1/2, knip 2/2, graphql (apps/server), typecheck (3 packages), and test (2 files, 14 tests) all passed.
vp test run apps/server/src/orchestration-v2/NativeChildWorkQuery.test.ts apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts: 2 files, 27 tests passed.
vp run --filter t3 build: 2/2 succeeded (apps/web + apps/server).
- Not checked: Windows/Linux hosts and a live 1.4.5 managed-runtime session (legacy 1.4.x SQLite path is unchanged and covered by existing unit tests).
Written with Gemini 4 Neon in Antigravity.
No actionable comments were generated in the recent review.
Walkthrough
The change resolves detached Antigravity subagent launch IDs from child inbox files, loads the associated transcript when available, and falls back to the parent session SQLite record when detached lookup finds no record.
Changes: Antigravity detached child resolution
apps/server/src/provider/acp/AntigravityChildWork.ts,apps/server/src/provider/acp/AntigravityChildWork.test.tsinvoke_subagentcalls by tool-call ID. It uses launch arguments or descriptor and message data, and rejects invalid, unreadable, mismatched, or ambiguous matches. Tests cover matching, metadata fallbacks, transcript parsing, and rejection cases.apps/server/src/provider/acp/AntigravityChildWork.tslogUri; when present, the URI must resolve to the expected transcript path.Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: Low
Possibly related issues
Possibly related PRs
invoke_subagentcalls.Suggested reviewers:
t3dotgg,macroscopeappMerge Risk:
Low · up to
e4e8bThe change makes detached Antigravity subagent transcripts readable. Two minor hardening gaps remain open in filesystem handling of child inboxes and metadata. They have limited impact and can be handled as follow-up or fixed before merge.
Pre-merge checks:
4
Full details: Title check
Explanation
The title "fix(server): read detached Antigravity 1.5 subagent transcripts" matches the main change: the server now resolves detached agy 1.5 child records and reads their transcript.jsonl files. It is a conventional commit with a plain-language summary and names the affected component.
Full details: Description check
Explanation
The description follows the template sections (Problem, Change, Scope, Verification) and fills each one with specific content: the failing behavior, the server-only fix in AntigravityChildWork.ts, a link to the related issue and prior PR, before/after captures, unit test results, and checks that were not run. It also names the model and harness, as the template asks. The Problem section gives a reproduction environment (agy 1.5.12, Google OAuth). The Scope section cites the related issue (
#38478) and the follow-up gap from#38966. The template's Scope asks for a link to the issue that shows the bug. The description refers to#38478by number only and gives no URL, so the link requirement is only partly met. The Problem section also says "Verified against real" without a reproduction command in the description. Otherwise the description is mostly complete.Finishing Touches
Generate unit tests (beta)
a9a416be-bc12-446c-9d3d-66c995cb23e7Reviewing files that changed from the base of the PR and between f3c4710b0c3183c0f771c1ee0a65b03268facc5c and e4e8b460c27885f99837e44c29263ff243e42eb6.
apps/server/src/provider/acp/AntigravityChildWork.test.tsIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.