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 a thread in T3 Code using the Antigravity provider (
antigravity-acp,agy1.5.19,gemini-4-neon,full-accessmode). - In a turn, have the agent spawn a native
selfsubagent viainvoke_subagentwhose prompt asks it to reply directly without callingsend_message. - Wait for the subagent to finish its reply and go idle. Antigravity delivers a wake-up message to the parent's inbox with
sender: "system"andcontent: "Subagent <childId> has gone idle. This was the subagent's most recent response: ...", while leaving the detached subagent alive/idle on disk (notSUBAGENT_STATE_KILLED). - Let the parent agent send its final response and stop calling tools.
Expected behavior
Once the subagent has gone idle and the parent finishes responding, T3 Code should transition the subagent out of running and finalize the turn (clearing the Thinking spinner and active stop button).
Actual behavior
The turn never terminates:
- The
selfsubagent item stays stuck instatus: "running"indefinitely (even though aresearchsubagent in the same turn that calledsend_messagetransitioned toidle). - The parent run stays
status: "running"(completedAt: null), leaving theThinkingindicator and red stop button active in the UI after the assistant's final message is complete. - Every subsequent user message is steered into the same stuck run instead of starting a new turn, and the run still cannot finalize after those responses finish.
Root cause (verified on main @ ee43aabaa)
In apps/server/src/provider/acp/AntigravityChildWork.ts:1607-1621, readAntigravityChildrenAtWork determines whether a detached child is done only by checking:
reported.has(childId)— built strictly frommessage.senderacross the parent's inbox (.system_generated/messages/*.json),- swarm
killed/parkedflags, or subagent?.state === "SUBAGENT_STATE_KILLED".
When an Antigravity subagent finishes with a normal reply and goes idle (rather than calling send_message), Antigravity writes the parent inbox notification with sender: "system" and puts the child's ID in sourceMetadata.conversationId (and in content):
{
"id": "<messageId>",
"recipient": "<rootSessionId>",
"sender": "system",
"priority": "MESSAGE_PRIORITY_HIGH",
"content": "Subagent <childId> has gone idle. This was the subagent's most recent response: ...",
"sourceMetadata": {
"conversationId": "<childId>",
"stepIndex": 1,
"rootConversationId": "<rootSessionId>",
"contentKind": "CONTENT_KIND_CONVERSATION"
}
}Because message.sender is "system" rather than <childId> and the subagent is idle rather than SUBAGENT_STATE_KILLED, readAntigravityChildrenAtWork continues returning the launching toolCallId as still at work. AcpAdapterV2.idleReportedSubagents therefore leaves the subagent in running, hasDeferredBackgroundWork returns true (with deferFinalizeForBackgroundWork enabled for Antigravity), and followPrompt returns early without calling finalizeTurn.
Suggested fix: In readAntigravityChildrenAtWork, also treat a child as reported/idle when the parent inbox contains a sender: "system" idle notification whose sourceMetadata.conversationId matches childId (respecting message ordering if the child is later woken again via send_message).
Impact
Major degradation or frequent failure
Version or commit
Observed on T3 Code Desktop/Server 0.1.13; verified unfixed on main @ ee43aabaa
Environment
macOS arm64 (Mac mini), T3 Code Beta 0.1.13, Antigravity ACP Server 1.5.19, Model gemini-4-neon (High), full-access mode
Logs or stack traces
# Parent inbox message when a `self` subagent finishes without calling `send_message`:
{"recipient":"<rootSessionId>","sender":"system","priority":"MESSAGE_PRIORITY_HIGH","content":"Subagent <childId> has gone idle. This was the subagent's most recent response: ...","sourceMetadata":{"conversationId":"<childId>","stepIndex":1,"rootConversationId":"<rootSessionId>","contentKind":"CONTENT_KIND_CONVERSATION"}}
# Thread state after parent finished replying (3 consecutive steered follow-ups later):
# - run:ordinal:4 stayed status="running", completedAt=null for ~18 minutes
# - `research` subagent (used send_message, sender=<childId>): status="idle"
# - two `self` subagents (idle notice, sender="system"): status="running"
# - Immediately after running manage_subagents(Action="kill_all") -> state="SUBAGENT_STATE_KILLED",
# run:ordinal:4 completed cleanly at the end of that turn.
Workaround
Explicitly killing idle Antigravity subagents via manage_subagents(Action="kill_all") sets their on-disk state to SUBAGENT_STATE_KILLED, after which readAntigravityChildrenAtWork clears them and the stuck turn finalizes normally.
Activity