Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Antigravity idle session release kills live /swarm workers and detached subagents via session/close #41830

Closedshea786(GitHub profile, opens in a new tab) opened this issue 1 comment

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

  1. Start a normal Antigravity thread in T3 Code (agy 1.5.14 / 1.5.15).
  2. Start native Antigravity background work that outlives the coordinator's ACP turn — e.g., launch /swarm workers (swarm/members.json) or a detached invoke_subagent (subagents/*.json) — and let the parent turn settle to idle.
  3. Leave the thread idle past NO_NATIVE_RESUME_IDLE_TIMEOUT_MS (30 minutes; ACP reports supportsNativeResume: false in packages/provider-acp/src/server/adapter.ts:876).

Expected behavior

  • ProviderSessionManager keeps the Antigravity ACP session pinned while /swarm workers, detached subagents, or unread high-priority wakes are live.
  • When an idle Antigravity session is eventually torn down (no live background work), T3 Code does not send session/close, which Antigravity handles as ForceStopCascadeTree (kill_background_tasks=true).

Actual behavior

  • Because AcpAdapterV2 only checks in-memory ACP turn/subagent state (and does not inspect Antigravity's native swarm/members.json, detached subagents/*.json, or inbox/transcript wake files), hasPendingBackgroundWork reports no work once the parent turn settles.
  • At 30 minutes (NO_NATIVE_RESUME_IDLE_TIMEOUT_MS), ProviderSessionManager releases the session as idle, and ACP scope teardown sends session/close before terminating the per-thread antigravity acp child process.
  • agy handles session/close by running ForceStopCascadeTree (kill_background_tasks=true), cancelling all live swarm worker cascades and injecting [Notice] All your subagents and background tasks have been stopped due to user force cancellation. / server restart. into the parent session inbox.

Related issues covering distinct paths:

  • #39886 covers immediate session/close when a delegated Antigravity task settles on turn end.
  • #41700 covers a plain background run_command outliving the post-settle hold.

Impact

Major degradation or frequent failure

Version or commit

0.1.11 and main @ 700a4644a4

Environment

Linux 7.0.0-44-generic, Node v24.21.0, T3 Code 0.1.11, Antigravity agy 1.5.14 / 1.5.15, Gemini 4 Neon

Logs or stack traces

# agy acp-server log (stock T3 Code 0.1.11, 30 min after session/prompt)
I1123 20:04:48.134536    4535 server.go:213] ACP Request received: session/close
I1123 20:04:48.134601    4535 rpcs_backend.go:482] ForceStopCascadeTree requested: cascade_id="35b73743-..."
I1123 20:04:48.136045    4535 cascade_manager.go:2644] Cancel requested for cascade e17fab35-... (kill_background_tasks=true)
I1123 20:04:48.136062    4535 cascade_manager.go:2644] Cancel requested for cascade a854b43f-... (kill_background_tasks=true)
I1123 20:04:48.136069    4535 cascade_manager.go:2644] Cancel requested for cascade 2a208f40-... (kill_background_tasks=true)
I1123 20:04:48.136075    4535 cascade_manager.go:2644] Cancel requested for cascade c46332d6-... (kill_background_tasks=true)
I1123 20:04:48.136081    4535 cascade_manager.go:2644] Cancel requested for cascade 35b73743-... (kill_background_tasks=true)
I1123 20:04:48.167694     217 server.go:4523] Got signal terminated, shutting down

Inbox notice written to the parent session:

[Notice] All your subagents and background tasks have been stopped due to user force cancellation. / server restart.

Workaround

None without keeping the thread busy every 30 minutes. Fix PR is #41693.

  1. tanstack-source added labelsbug

  2. This is the same problem as #39886, so I'm closing it in favour of that one. If it is different, say how and it will be reopened.

  3. juliusmarminge closed this

Sign in to join this conversation.