Thread-bound scheduled task never sends while an Antigravity swarm root is parked in swarm_wait #49789
What happened#
In an Antigravity swarm-mode thread I set up a scheduled task (via schedule_task, bound to the thread, every 20 min) as a watchdog to revive stalled subagents. The first time it fired, its message didn't send. It sat in the thread queue waiting to be sent, and I had to press "Send now" by hand. There is no way to make the automation itself send now.
The root agent was not actually busy. It was parked in "Wait for swarm board" while its subagents worked, but T3 Code treats the thread as fully active, so the automation's message queues behind a turn that never ends.
Diagnosis#
Three things combine:
- Scheduled tasks always queue.
ScheduledTaskServiceposts to a bound thread with a hardcodedmode: "queue"(apps/server/src/scheduledTasks/ScheduledTaskService.ts,sendBound).OrchestratorMcpScheduleTaskInputhas no delivery option (onlyprompt,schedule,title,enabled,bindToCurrentThread,freshSession). A queued message dispatches only when the active run ends. - A swarm root's turn never ends. In swarm mode the root agent loops on
read_board/swarm_waitinside onesession/prompt. Run 3 of this thread has beenrunningsince 05:51:26Z. The root does no work of its own between board events, but from T3 Code's view the run is in progress the whole time. - The parked state isn't recognized. T3 Code already has a notion of a run that is only waiting:
deriveBlockedOnThreadWait(packages/shared/src/orchestrationV2PendingBackgroundWork.ts). But it only countst3_thread_waitanddelegate_taskwithmode: "wait". An Antigravityswarm_wait(shown as "Wait for swarm board",kind: "think") is not counted, so the thread reportsblockedOnThreadWait: falseand the sidebar shows "Working" rather than "Waiting". Even for the waits it does recognize, the flag only drives the sidebar label and MCP thread listings. Neither the queue nor scheduled-task delivery reads it, so nothing delivers a queued message while a turn is parked.
So in a swarm thread the watchdog message queues forever. Worse, once one occurrence is stuck in the queue, later occurrences don't post at all: unfinishedOccurrence finds the queued one and rescheduleMissedRun records "previous occurrence still queued". A thread-bound watchdog in a swarm thread therefore fires once and then never runs.
Pressing "Send now" works because it promotes the queued message to a steer (promoted_queued_to_steer), which cancels the queued run (run 4, now cancelled) and joins the active one. Antigravity accepts steers while the root sits in swarm_wait (see #49784), so the swarm agent could have taken the message at any time.
The task also recorded last_run_status: succeeded for the occurrence even though the message never reached the agent until I promoted it by hand.
Steps to reproduce#
- Start an Antigravity thread (agy 1.5.23,
gemini-4-neon) in swarm mode, with the root agent coordinating subagents and parking inswarm_wait("Wait for swarm board") between board events. - From that thread, have the agent create a scheduled task bound to the current thread (
bindToCurrentThread: true,freshSession: false, interval schedule). - Wait for the first occurrence while the root is still parked in
swarm_wait. - The message shows in the thread queue as waiting to be sent and never dispatches. The sidebar shows the thread as "Working".
- Without pressing "Send now", later occurrences are skipped as "previous occurrence still queued".
Version#
0.1.15-nightly.20261205.5786 (server and desktop; commit be521199aace)
Environment#
macOS (darwin arm64), Node 24.22.1, agy 1.5.23 (antigravity, gemini-4-neon, swarm mode). Seen in both the mobile and desktop apps.
Evidence#
# scheduled_tasks row
schedule_json {"type":"interval","everyMs":1200000}
thread_mode continue
created_at 2026-12-06T06:06:30Z
last_run_at 2026-12-06T06:26:31.569Z last_run_status succeeded run_count 1
next_run_at 2026-12-06T06:46:31.644Z
# runs in the bound thread
ordinal 3 running (started 05:51:26Z; root looping on read_board / swarm_wait)
ordinal 4 cancelled (the queued scheduled occurrence, cancelled when "Send now" promoted it to a steer)
# promoted message
message_id scheduled-task-message:<task>:1796538391569:scheduled created 06:27:35Z
# thread shell while parked
status running, blockedOnThreadWait false
Related issues#
#49784 (filed from the same thread): Antigravity steers absorbed during swarm_wait show "waiting to be read" and are placed after their own answer. That is a different bug, but it shows Antigravity reads steers during swarm_wait. No existing issue found for scheduled tasks queuing behind long-running or parked turns.
Possible directions (for maintainers to judge): count Antigravity swarm_wait (and similar provider-native board waits) in deriveBlockedOnThreadWait; let a thread-bound scheduled task steer, or promote its queued message to a steer, when the active run is only parked in a wait; and/or add a delivery option to schedule_task.
Fix applied or workaround#
None applied. Workarounds: press "Send now" on each queued occurrence, or tell the swarm root to end its turn after each check rather than parking in swarm_wait, so the thread goes idle and scheduled messages start a new run right away.
Filed by#
Claude Code (claude-opus-5-5) via t3 triage
joshrad-dev(GitHub profile, opens in a new tab) added labelsvia-triage
tanstack-source added labelsbug
Sign in to join this conversation.