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 thread and send:
Run exactly this shell command with run_command, with WaitMsBeforeAsync set to 5000 so that it continues as a background task:
sleep 4500; date > done.txt. Do not wait for it in the foreground, do not poll it, and do not use the schedule tool. Reply only "Waiting for the background command." and end your turn. Later, when the command has finished and you are woken by its completion, reply exactly "BG DONE" followed by the contents of done.txt. - Antigravity replies "Waiting for the background command." and the
sleepkeeps running. - Leave the thread alone for 75 minutes.
Expected behavior
The agy acp process stays alive while its background command runs. When the command finishes, its completion reaches T3, and a continuation run replies "BG DONE ".
Actual behavior
| Time from start | What happens |
|---|---|
| ~0:31 | The post-settle hold (#40858) closes the turn as completed. |
| ~1:00 | ProviderSessionManager releases the session as idle (idle_timeout). agy acp exits, and the sleep, its child, is killed. |
| 1:15 and later | Nothing happens. No wake arrives, pendingBackgroundTasks is [], and the thread stays idle indefinitely. |
Cause:
- The Antigravity flavor has no
extractBackgroundTaskId, so a quietrun_commandnever entersrunningBackgroundTaskIds. - Once the hold has terminalized the command's row, the ACP runtime's
hasPendingBackgroundWorkfinds nothing pending: no buffered wake, no continuation, no tracked task ID and no active turn. The manager therefore releases the session. - The continuation path from fix(server): Antigravity threads keep going after a background command finishes #38864 would deliver the wake, but only while the transport is alive.
By comparison, the Claude driver's idle probe consults its task roster, which keeps the CLI process alive.
Any command that needs more than about an hour is lost, not merely left unreported. We hit this twice with long test suites, losing about an hour of work each time.
Related issues and PRs, which do not cover this case:
- Antigravity orphaned background commands hold completed turns in running with no UI indicator and deadlock delegated parent threads #39820 tracks Antigravity background commands as pending work.
- fix(antigravity): Show background command summaries and live output #40687 shows them in the UI.
- fix(server): idle Antigravity sessions no longer kill live swarms or subagents #41693 pins idle Antigravity sessions for
/swarmworkers and detached subagents. It does not cover a plainrun_command, and it touches the samehasPendingBackgroundWorkpath inpackages/provider-acp/src/server/adapter.ts. - A Pi session is released as idle while async pi-subagents runs are still working, which kills them #41648 is the same class of bug for Pi.
A fix PR follows.
Impact
Major degradation or frequent failure
Version or commit
0.1.12-nightly.20261123.5124. The same path is on main @ e3ac310: the files involved are unchanged, and ACP still reports supportsNativeResume: false, so it keeps the 30-minute idle timeout after #41174.
Environment
macOS (arm64), T3 Code Nightly desktop build run headless with t3 serve, Antigravity CLI 1.5.13, Gemini 4 Neon
Workaround
None found. Keeping the session busy, for example by having the agent poll its own command, avoids the release, but it costs turns.
Activity