Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- Start an Antigravity (
antigravity-acp,agy1.5.18) thread in T3 Code (Windows 11 x64,full-accessmode). - During a long-running parent turn (one that remains active across multiple tool calls / delegated tasks / context compaction / steers via
steersWithPrompt), have the parent spawn several native subagents viainvoke_subagent(e.g. Subagents A–F over several hours). - Let Subagents A–E finish and report back via
send_message(delivering messages to the parent inbox), and explicitly terminate them viamanage_subagents(Action="kill")(which updates their on-disk metadata to"state": "SUBAGENT_STATE_KILLED"). - Continue working in the same active/steered turn (e.g. sending follow-up steers or receiving completions from other delegated tasks that steer the parent turn) while only 1 subagent (Subagent F) remains genuinely alive.
- Call
manage_subagents(Action="list")and compare its output against T3 Code's Lineage panel andorchestration_v2_projection_subagents.
Expected behavior
Once a native Antigravity subagent reports back to the parent inbox or is explicitly killed via manage_subagents(Action="kill" | "kill_all"), T3 Code should reconcile its status promptly so it transitions out of running and stops ticking in the Lineage panel — even while the parent turn remains active or is repeatedly steered.
Actual behavior
Killed and already-reported native Antigravity subagents remain permanently stuck in status: "running" (completed_at: null) in orchestration_v2_projection_subagents and in the Lineage panel, with their elapsed timers continuously ticking (1.5h, 3.4h, 6.7h, etc.):
- In a live session,
manage_subagents(Action="list")reported 1 active subagent, while T3 Code's Lineage panel simultaneously showedLineage · 6 running— including 5 subagents that had already reported back to the parent inbox and been explicitly killed viamanage_subagents(Action="kill")(both before and after conversation context compaction). - On disk under
antigravity-acp/brain/<rootSessionId>/.system_generated/subagents/<childId>.json, all 5 killed subagents already have"state": "SUBAGENT_STATE_KILLED"and have messages in the parent's inbox. None of them are running or consuming CPU/tokens inside Antigravity.
Root cause (verified on main @ 3fcfcaee2)
PR #39519 (fixing #39513) already updated readAntigravityChildrenAtWork in apps/server/src/provider/acp/AntigravityChildWork.ts to exclude children whose metadata has state === "SUBAGENT_STATE_KILLED" or that have already reported to the parent inbox. Running readAntigravityChildrenAtWork's exact logic against the affected session's on-disk files correctly returns only the 1 genuinely active child (excluding all 5 killed subagents).
The bug is that idleReportedSubagents(context) in packages/provider-acp/src/server/adapter.ts is never invoked during an active or repeatedly steered Antigravity turn. Across the entire adapter, idleReportedSubagents is only called in three places:
-
handleSessionUpdateonusage_update(packages/provider-acp/src/server/adapter.ts:6746-6749) — gated bycontext.promptSettled:if (update.sessionUpdate === "usage_update") { context.replyOpen = false; if (context.promptSettled) yield* idleReportedSubagents(context); yield* rearmDeferredFinalize(context); }
While a
session/promptis in flight (or aftersteerWithPromptresetscontext.promptSettled = falseat line10970),context.promptSettledisfalse, so everyusage_updateskipsidleReportedSubagents(context). -
followPromptonsession/promptresolution (packages/provider-acp/src/server/adapter.ts:10288, 10370) — skipped whensuperseded()is true:if (context.finalized || followsAgentWorkState || superseded()) return; ... yield* idleReportedSubagents(context);
Because Antigravity uses
steersWithPrompt: antigravitySteersWithPrompt(AntigravityAdapterV2.ts:271), each steer incrementscontext.promptSequence(adapter.ts:10206-10207) and resetscontext.promptSettled = false(adapter.ts:10970) before the priorsession/promptfinishes resolving (~10–50 ms later in server traces). Every supersededsession/prompttherefore exits at line10288without ever callingidleReportedSubagents(context). -
Continuation run
wakeBufferdrain (packages/provider-acp/src/server/adapter.ts:10787) — only runs after a turn actually finalizes and a new continuation run starts.
Additionally, completing a manage_subagents (Action: "kill" / "kill_all") tool call via tool_call_update never triggers idleReportedSubagents(context).
As a compounding side effect, because those killed/reported subagents remain "running" in context.subagents, promptInactivityPaused (adapter.ts:9864-9866) and hasDeferredBackgroundWork (adapter.ts:5311-5315) continue treating them as active background work until a session/prompt finally resolves without being superseded.
Suggested fix direction
Run idleReportedSubagents(context) (when flavor.subagentsOutlivingPrompt !== undefined and context.subagents has active entries) at one or more mid-turn boundaries rather than exclusively when context.promptSettled === true on an unsuperseded prompt return, for example:
- On
usage_updateinhandleSessionUpdate(adapter.ts:6748) even when!context.promptSettled(possibly throttled/gated on having active subagents), and/or - When a
manage_subagentstool call completes viatool_call_update, and/or - Inside
steerWithPrompt(or before early-returning onsuperseded()infollowPrompt).
Relation to existing issues / PRs
- Distinct from Antigravity native subagent killed via manage_subagents stays stuck in running and blocks turn finalization #39513 (closed by fix(server): a killed Antigravity subagent no longer keeps its turn running #39519): fix(server): a killed Antigravity subagent no longer keeps its turn running #39519 fixed
readAntigravityChildrenAtWorkto inspectSUBAGENT_STATE_KILLED, which works when called; this bug is thatadapter.tsnever callsidleReportedSubagentsduring active/steered turns. - Distinct from [Bug]: Finished Antigravity native subagents linger in the sidebar as unsettled threads with blue unread dots #42463 / fix(server): Antigravity subagents that go idle without a message no longer stay Running #42498: [Bug]: Finished Antigravity native subagents linger in the sidebar as unsettled threads with blue unread dots #42463 tracks already-
idlesubagent threads lingering unsettled in the sidebar, and PR fix(server): Antigravity subagents that go idle without a message no longer stay Running #42498 addssystem"has gone idle"notice parsing insidereadAntigravityChildrenAtWorkwithout changingidleReportedSubagentsinvocation sites inadapter.ts.
Impact
Major degradation or frequent failure
Version or commit
Observed on T3 Code server 0.1.12 (Desktop 0.0.24); root cause verified unfixed on main @ 3fcfcaee2 (2026-11-27)
Environment
Windows 11 x64 (10.0.26200), T3 Code Server 0.1.12 / Desktop 0.0.24, Provider: Antigravity ACP (agy 1.5.18), Model: gemini-4-neon, Runtime mode: full-access
Logs or stack traces
# Live state observed in the same thread during an active/steered Antigravity turn:
# 1. Antigravity manage_subagents(Action="list") -> 1 active subagent
# 2. T3 Code Lineage panel -> "Lineage · 6 running" (timers at 1.5h, 3.4h, 6.7h, etc.)
# 3. On-disk Antigravity state for those 6 subagents:
# - 5 subagents: state = "SUBAGENT_STATE_KILLED", reportedInParentInbox = true
# - 1 subagent: state = "SUBAGENT_STATE_ALIVE" (the genuinely active one)
# 4. Server traces (server.trace.ndjson) across 38 consecutive AcpAdapterV2.steerTurn spans
# on this thread show 0 AcpAdapterV2.idleReportedSubagents spans executed: each prior
# session/prompt resolves 8–50 ms after the next steerWithPrompt increments promptSequence
# and resets promptSettled = false, hitting the early `if (... || superseded()) return;`
# at packages/provider-acp/src/server/adapter.ts:10288.Screenshots, recordings, or supporting files
No response
Workaround
Letting the parent turn finish completely without any further steers (or stopping the parent turn) forces finalization and clears the stuck running subagents.
Activity
test(server): Antigravity subagent that reports during a steered prom…