[Bug]: Antigravity ACP background tasks remain stuck in RUNNING state after manage_task kill or timer expiry
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
- In an Antigravity ACP thread on Windows, start a background command via
run_command(e.g.,WaitMsBeforeAsync: 5000) or schedule a one-shot timer viaschedule(e.g.,DurationSeconds: 480). - Cancel the background task using
manage_task(Action: "kill", TaskId: "<task-id>")(which returnsTask "<task-id>" cancelled.), or wait past the scheduled fire timestamp of the one-shot timer. - Verify at the OS level that all child processes have exited.
- Call
manage_task(Action: "list")ormanage_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:
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)
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:
-
Unreconciled
steps.status = 2(RUNNING) inantigravity-acp/conversations/<conversation-id>.db:- In the
stepstable (idx, step_type, status, task_details), the orphaned background tasks (step_type = 21run_commandandstep_type = 132schedule) remain persisted on disk withstatus = 2(RUNNING). - When T3 Code restarts and spawns a new
Antigravity.exeprocess, it loads the conversation trajectory from<conversation-id>.dbwithout reconcilingstatus = 2steps 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 SQLitesteps.statusfrom2(RUNNING) to6(CANCELED); callingmanage_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. Instatev2.sqlite(orchestration_v2_projection_runs), turnsordinal: 56,57,58,61never transition tocompletedafter the assistant finishes replying—they stayrunningindefinitely until interrupted.
- In the
-
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 instatus = 'running'(e.g., 157dynamic_toolitems and 4file_changeitems in a single turn of another Antigravity thread) even after the tool results have already been returned and consumed by the model.
- In
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 index756, command./validate.sh --sequential --subsystem small).
Live Observations:
- 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.
- 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 inRUNNINGstate:{ "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 }
- Calling
- 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;returns756|21|2(status = 2/ RUNNING). - In
.t3/userdata/statev2.sqlite,orchestration_v2_projection_runsremains instatus = 'running'for this thread (ordinal: 9). - Consequently, the UI continues displaying persistent active/"thinking" state despite the turn being completely finished and idle.
- Querying the SQLite trajectory database
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:
- A turn launched a background
run_command(step_type = 21,steps.status = 2). - ~12s later, the turn failed with
429 Individual quota reachedand the harness exited without marking the background task finished. - On every restart /
session/load, the dead task stayedRUNNINGinconversations/<session-id>.dbeven with no OS process left, and callingmanage_task(Action="kill")returned"cancelled."without persisting across restarts. - In
0.1.9, every follow-up message in that thread then replies normally, never resolvessession/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.