Skip to content

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

Duplicate

Description

@shea786

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 @ 700a464

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.

Activity

  1. juliusmarminge commented on Nov 24, 2026

    @juliusmarminge
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions