t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: Antigravity ACP background tasks remain stuck in RUNNING state after manage_task kill or timer expiry

Open marrsv5-afk opened this issue 1 month ago • 3 comments

Before submitting

  • [x] I searched existing issues and did not find a duplicate.
  • [x] I included enough detail to reproduce or investigate the problem.

Area

apps/desktop

Steps to reproduce

  1. In an Antigravity ACP thread on Windows, start a background command via run_command (e.g., WaitMsBeforeAsync: 5000) or schedule a one-shot timer via schedule (e.g., DurationSeconds: 480).
  2. Cancel the background task using manage_task(Action: "kill", TaskId: "<task-id>") (which returns Task "<task-id>" cancelled.), or wait past the scheduled fire timestamp of the one-shot timer.
  3. Verify at the OS level that all child processes have exited.
  4. Call manage_task(Action: "list") or manage_task(Action: "status", TaskId: "<task-id>") and observe the T3 Code thread status indicator.

Expected behavior

Once manage_task(Action: "kill") succeeds (or once a one-shot schedule timer passes its Expected to fire at timestamp and is cancelled), the task entry in the Antigravity ACP task registry should transition out of RUNNING state and be removed from manage_task(Action: "list"), allowing the T3 thread UI to return to idle.

Actual behavior

manage_task(Action: "kill") returns Task "<task-id>" cancelled., and no OS child processes remain, but manage_task(Action: "list") and manage_task(Action: "status") continue to report Status: RUNNING indefinitely:

``text Task: /task-1 Status: RUNNING Last progress: never

Task: /task-2 Status: RUNNING Expected to fire at: 2026-10-27T02:06:37+08:00 Last progress: 39m34s ago ``

Because these zombie task entries remain in RUNNING state inside the Antigravity ACP harness, the T3 Code thread UI stays stuck showing the run as active/in-progress even after all work has finished.

Impact

Visual annoyance / keeps thread stuck in running state after work completes

Version or commit

T3 Code (Beta) 0.1.2 (0.1.2.0)

Environment

Windows 10/11 x64, Provider: antigravity (antigravity-acp)

marrsv5-afk avatar Oct 26 '26 19:10 marrsv5-afk

Forensic Update: Why Zombie Tasks Survive App Restart & Block Turn Completion

After restarting T3 Code (Antigravity.exe respawned with a fresh PID), the zombie tasks still persisted and every subsequent turn in the thread failed to transition to completed (remaining running until manually interrupted). Inspecting both SQLite databases (antigravity-acp/conversations/<id>.db and .t3/userdata/statev2.sqlite) revealed the exact two-layer mechanism:

  1. Unreconciled steps.status = 2 (RUNNING) in antigravity-acp/conversations/<conversation-id>.db:

    • In the steps table (idx, step_type, status, task_details), the orphaned background tasks (step_type = 21 run_command and step_type = 132 schedule) remain persisted on disk with status = 2 (RUNNING).
    • When T3 Code restarts and spawns a new Antigravity.exe process, it loads the conversation trajectory from <conversation-id>.db without reconciling status = 2 steps against live OS processes/timers.
    • Calling manage_task(action="kill") after restart returns "Task '<id>' cancelled.", but does not update the in-memory trajectory step or SQLite steps.status from 2 (RUNNING) to 6 (CANCELED); calling manage_task(action="list") immediately afterward still returns the exact same tasks.
    • Because the trajectory still contains steps with status = 2, the Antigravity harness considers background dependents still active at the end of every subsequent turn. In statev2.sqlite (orchestration_v2_projection_runs), turns ordinal: 56, 57, 58, 61 never transition to completed after the assistant finishes replying—they stay running indefinitely until interrupted.
  2. Unclosed turn_items (status = 'running') in .t3/userdata/statev2.sqlite:

    • In orchestration_v2_projection_turn_items, tool calls (dynamic_tool, file_change) emitted through the Antigravity ACP bridge frequently remain in status = 'running' (e.g., 157 dynamic_tool items and 4 file_change items in a single turn of another Antigravity thread) even after the tool results have already been returned and consumed by the model.

marrsv5-afk avatar Oct 27 '26 05:10 marrsv5-afk

macOS Telemetry & Reproduction Evidence (T3 Code Beta / Antigravity ACP)

Can confirm this issue on macOS as well (local time Nov 8, 2026). Here is live reproduction data showing the exact failure mode in an active Antigravity session:

Environment & Reproduction:

  • OS: macOS (Darwin arm64)
  • Harness: Antigravity ACP (gemini-3.8-flash)
  • Conversation ID: 4bb4a8ac-7126-4867-a8d8-b4d62dc6c581
  • Action: Launched background task via run_command (step index 756, command ./validate.sh --sequential --subsystem small).

Live Observations:

  1. Underlying process terminates/vanishes:
    • ps -ef | grep -E "756|validate" confirms zero OS processes exist for the command.
    • The log file (.system_generated/tasks/task-756.log) stopped receiving writes over an hour ago.
  2. Explicit cancellation succeeds at API level but fails in state machine:
    • Calling manage_task(Action: "kill", TaskId: "4bb4a8ac-7126-4867-a8d8-b4d62dc6c581/task-756") returns: Task "4bb4a8ac-7126-4867-a8d8-b4d62dc6c581/task-756" cancelled.
    • An immediate call to manage_task(Action: "list") still lists the task in RUNNING state:
      {
        "taskId": "4bb4a8ac-7126-4867-a8d8-b4d62dc6c581/task-756",
        "toolName": "run_command",
        "toolSummary": "Run ./validate.sh --sequential --subsystem small",
        "startTime": "2026-11-08T23:27:56.261554Z",
        "stepIndex": 756
      }
      
  3. Database Trajectory Ground Truth:
    • Querying the SQLite trajectory database .t3/userdata/providers/antigravity/.../conversations/4bb4a8ac-7126-4867-a8d8-b4d62dc6c581.db: SELECT idx, step_type, status FROM steps WHERE idx = 756; returns 756|21|2 (status = 2 / RUNNING).
    • In .t3/userdata/statev2.sqlite, orchestration_v2_projection_runs remains in status = 'running' for this thread (ordinal: 9).
    • Consequently, the UI continues displaying persistent active/"thinking" state despite the turn being completely finished and idle.

noelsaw1 avatar Nov 09 '26 01:11 noelsaw1

Adding another macOS reproduction (T3 Code 0.1.9 + managed antigravity-acp 1.4.5, darwin-arm64), triggered by an upstream 429 error rather than manual Stop / manage_task:

  1. A turn launched a background run_command (step_type = 21, steps.status = 2).
  2. ~12s later, the turn failed with 429 Individual quota reached and the harness exited without marking the background task finished.
  3. On every restart / session/load, the dead task stayed RUNNING in conversations/<session-id>.db even with no OS process left, and calling manage_task(Action="kill") returned "cancelled." without persisting across restarts.
  4. In 0.1.9, every follow-up message in that thread then replies normally, never resolves session/prompt, and hits the 15-minute inactivity watchdog (Antigravity sent nothing for 15 minutes...) in an endless loop (similar to #40646 / #26993).

Filed the upstream report at google-antigravity/antigravity-cli#1841.

Asuka109 avatar Nov 25 '26 07:11 Asuka109