Skip to content

fix(antigravity): threads resume when a timer wakes the agent - #4

Open
ryush00 wants to merge 21 commits into
forkfrom
t3/fix-stuck-thread-until-prompted
Open

ryush00 wants to merge 21 commits into
forkfrom
t3/fix-stuck-thread-until-prompted

Conversation

@ryush00

@ryush00 ryush00 commented Nov 19, 2026

Copy link
Copy Markdown
Owner

An Antigravity thread (MineList, Ruby2Shell deploy watch) scheduled a 60 s check, then sat idle for seven minutes. The agent's two wake replies (19:29 and 19:31) only showed up when the user asked "왜 멈춰있니".

Cause

Fix

  • Restore AntigravityWakeWatcher. After a completed turn it polls <profile>/antigravity-acp/conversations/<session>.db for a wake step with no reply after it. It then queues a message_text continuation whose prompt reattaches the stream. The prompt text is rewritten to a short system note.
  • AcpAdapterV2Flavor.watchPostSettleWake is the hook. The adapter starts the watcher when a turn completes and stops it on the next turn, a Stop, a runtime restart, a replacement session or close.
  • When agy does stream a wake, upstream's buffered continuation still applies. Only one continuation can be requested at a time, so a second wake from the watcher is refused.

Tests

  • AntigravityWakeWatcher.test.ts (restored) covers wake detection, the settle grace and dedup.
  • New AntigravityAdapterV2.test.ts case: a schedule turn ends, a wake step lands in the native log with no frames, the adapter queues a message_text continuation and the next prompt carries the reattach note. Without the wiring the test hangs waiting for the wake, as the real thread did.
  • vp run check:changed: format, lint, knip and typecheck pass. Orchestrator.control-reads.test.ts has 2 failures that also fail on fork without this change.

Model and harness: Claude Opus 5.5 in Claude Code via T3 Code.

🤖 Generated with Claude Code

ryush00 and others added 21 commits November 19, 2026 18:40
The agy CLI asks before every tool in its `default` mode, and accounts
without `auto` have no mode that stops it. Full-access now starts agy with
`--dangerously-skip-permissions`. It is a spawn flag, so a turn that
switches to or from full-access restarts the runtime with the new policy.
Session modes map to what the CLI or the managed runtime advertises.

This patch used to carry a watcher that re-prompted agy after a background
command finished. Upstream pingdotgg#38864 and pingdotgg#38916 now continue those replies, so
the watcher is gone.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…m daily

Fork-only release and sync infrastructure: a desktop release workflow for
macOS and Windows, nightly prereleases with synced upstream commits in the
notes, a daily upstream sync, and macOS signing (Developer ID when secrets
exist, otherwise ad hoc with a stable requirement) so builds update themselves.
…free-form answer

agy acp names the free-text companion of an ask_question choice qN_other and
puts the question in the choice title. The generic elicitation parser only
folds OMP's qN__other and reads the question from the description, so every
choice became two steps. Add an Antigravity extractElicitationForm, as the
OMP, Droid and OpenCode flavors have, that asks qN once with custom input and
sends typed text back as qN_other.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Antigravity threads set to Auto ran in Supervised: the provider never
offered Auto and mapped it to the agent's default mode. That was right
for the legacy 1.4 harness, which has no automatic review, but agy acp
1.5.4+ advertises and enforces an auto session mode.

Offer Auto from agy 1.5.4, send the session's auto mode when the session
advertises it, and leave the prompts the agent still sends to the user.
Sessions without auto (the 1.4 harness, Gemini Enterprise accounts) stay
in default and are answered as Supervised.

Fixes pingdotgg#37082

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
An open ACP session was reconfigured only when the model or the
interaction mode changed. Antigravity keeps its session across a
permission mode change, so switching Auto to Supervised left agy in its
auto mode, running edits and commands unasked under a Supervised label,
and Supervised to Auto stayed in default.

Reconfigure when the turn's policy asks for a different native mode,
native config, or ceiling than the session was last configured for, and
stop the Plan restore from putting back a mode the policy has replaced.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Antigravity's automatic review covers shell commands and edits but no MCP
call, so in Auto it asked about each one. The adapter passed every Auto
prompt to the user, on the assumption that a prompt is a review refusal.
In two real Auto threads, 27 of 28 T3 Code tool calls asked, against 6 of
147 shell commands.

Auto now answers prompts for T3 Code's own MCP tools itself, the same way
Claude pre-approves them: the authenticated MCP endpoint already enforces
their scope. Everything else the review refuses still reaches the user,
as do other MCP servers' tools.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
An Antigravity agent started a dev server, ended its turn with "I'll
continue once it's ready", and never resumed: agy wakes an ended turn
only when a background command exits, and a dev server never does. The
user waited 16 minutes before asking.

Tell the agent, in the session system prompt append and in per-turn
rules when the append is dropped, to wait for readiness with a command
that exits and continue in the same turn.

The mcp-tool-use eval has no Antigravity harness or Gemini models, so
this was checked with delegated gemini-4-carbon children on a slow-boot
server: without the text 2/2 ended their turn before fetching the page;
with it 2/2 fetched it in the same turn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… reports background work

A finished delegate's process was released unless the projection's
pendingBackgroundTasks was non-empty. Only the Claude adapter fills that field,
so an Antigravity or other ACP child was detached about a second after its turn
ended, killing the dev servers and schedule timers it had started and leaving
them looking pending.

The release now also asks the live runtime, through the same
sessionHasBackgroundWork probe that provider switches and fresh sessions already
use, and keeps the session when it reports work.

Done with Claude Opus 5.5 in Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…missing

Antigravity drops large t3-code schemas from its declarations, and the
cutoff can move after a resume or compaction. The model then saw most
T3 tools, decided the ACP fallback ("if the T3 tools are absent") did
not apply, and called Antigravity's generic call_mcp_tool, which
refuses t3-code tools ("tool preview_open is not enabled for server
t3-code"). The fallback now covers one missing tool and that rejection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An Antigravity thread that scheduled a 60 s check sat idle for seven
minutes and only showed the agent's two wake replies when the user asked
why it had stopped. agy 1.5.9 ends the prompt after `schedule`, runs the
wake in its native session, and sends no ACP frames until another prompt
reattaches the stream. Upstream's post-settle continuation (pingdotgg#38864,
pingdotgg#38916) only reacts to streamed frames, so nothing woke the thread. The
fork sync on 2026-11-19 dropped the wake watcher that covered this,
assuming upstream had replaced it.

Bring the watcher back. After a completed turn it polls the session's
native log for a wake step (101) with no reply after it, then queues a
message_text continuation whose prompt reattaches the stream. Upstream's
buffered continuation still wins when agy does stream, since only one
continuation can be requested at a time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T10:57:33.669520Z d5c48cb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants