Skip to content

[Bug]: Antigravity: idle release kills a background run_command that outlived its turn, so its wake never arrives #41700

Backlog

Description

@BluePlexus

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 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.

  2. Antigravity replies "Waiting for the background command." and the sleep keeps running.
  3. 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 quiet run_command never enters runningBackgroundTaskIds.
  • Once the hold has terminalized the command's row, the ACP runtime's hasPendingBackgroundWork finds 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:

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

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