Skip to content

fix(antigravity): show the agent's reply when a background command finishes after its turn - #135

Merged
maschwenk merged 6 commits into
mainfrom
fix/antigravity-background-wake
Dec 1, 2026
Merged

maschwenk merged 6 commits into
mainfrom
fix/antigravity-background-wake

Conversation

@maschwenk

Copy link
Copy Markdown
Owner

when an antigravity agent started a long command in the background and ended its turn, the thread looked finished and nothing came back. agy does wake up and reply on its own when the command finishes, but we dropped that reply because no prompt was open, so it only showed up after the next message. hit this on a poster thread: 51 images generating, no progress, and the agent's "i'll check them as they finish" never happened

this ports upstream's fix. the turn stays open (thread shows working) while a background command runs, so the finish and the agent's reply land in the same run. stop still ends it, t3_background_wait accepts antigravity's own commands, and a turn held only by a command that goes quiet for 30 minutes ends on its own, so a lost finish can't leave the thread stuck on working

upstream changes, cherry-picked with -x:

38864 drops its hermes and registry half, which the antigravity provider doesn't use. 40858 is ported by hand because upstream's diff sits inside the prompt-steer refactor we don't have. that also means agy's own schedule wakes aren't held (39806), and steering a wake run (39767) isn't here. the fork had never touched any of these files, so on the next upstream sync a conflict in them resolves by taking upstream's version

proof: talking acp straight to agy 1.5.12 with no t3 in between, the turn ended at 22 s, then agy sent the command's completion at 52 s and a reply at 55 s with no prompt open. the ported tests replay that shape and pass. not yet checked in a real thread on an installed build

still true after this: the fork closes an idle agent session after 30 min, so a background command that outlives the 30 min hold plus 30 min idle gets killed (upstream has the same problem, fix not merged)

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:L labels Nov 30, 2026
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 21.5 KiB 21.5 KiB 0 B (0.0%) 24.4 KiB ✅
Codex Live turn messages 1 1 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.9 KiB 21.9 KiB 0 B (0.0%) 24.4 KiB ✅
Claude Live turn messages 1 1 0 (0.0%) 8 ✅

Other scenarios

All 64 scenario measurements match main.

All 64 scenario measurements
Provider Scenario Metric Main baseline This PR Impact PR ceiling
Codex short turn resume WebSocket decoded 10.5 KiB 10.5 KiB 0 B (0.0%) 12.7 KiB ✅
Codex short turn resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex long turn running, cold open HTTP decoded 281.7 KiB 281.7 KiB 0 B (0.0%) 302.7 KiB ✅
Codex long turn running, cold open rows 75 75 0 (0.0%) 75 ✅
Codex long turn running, history page HTTP decoded 92.4 KiB 92.4 KiB 0 B (0.0%) 107.4 KiB ✅
Codex long turn running, history page rows 75 75 0 (0.0%) 75 ✅
Codex long turn finished, cold open HTTP decoded 381.5 KiB 381.5 KiB 0 B (0.0%) 410.2 KiB ✅
Codex long turn finished, cold open rows 151 151 0 (0.0%) 151 ✅
Codex long turn finished, socket cold open WebSocket decoded 381.6 KiB 381.6 KiB 0 B (0.0%) 410.2 KiB ✅
Codex long turn finished, socket cold open WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex long turn finished, socket cold open rows 151 151 0 (0.0%) 151 ✅
Codex long turn finished, work page HTTP decoded 186.2 KiB 186.2 KiB 0 B (0.0%) 200.2 KiB ✅
Codex long turn finished, work page rows 150 150 0 (0.0%) 150 ✅
Codex idle thread resume WebSocket decoded 65 B 65 B 0 B (0.0%) 200 B ✅
Codex idle thread resume WebSocket messages 1 1 0 (0.0%) 1 ✅
Codex fleet shell snapshot HTTP decoded 43.5 KiB 43.5 KiB 0 B (0.0%) 53.7 KiB ✅
Codex fleet shell snapshot rows 27 27 0 (0.0%) 27 ✅
Codex fleet shell subscribe WebSocket decoded 65 B 65 B 0 B (0.0%) 200 B ✅
Codex fleet shell subscribe WebSocket messages 1 1 0 (0.0%) 1 ✅
Codex fleet shell resume check HTTP decoded 18 B 18 B 0 B (0.0%) 100 B ✅
Codex fleet shell resume check rows 0 0 0 0 ✅
Codex stale shell reload HTTP decoded 43.5 KiB 43.5 KiB 0 B (0.0%) 53.7 KiB ✅
Codex stale shell reload rows 27 27 0 (0.0%) 27 ✅
Codex stale shell resume WebSocket decoded 140 B 140 B 0 B (0.0%) 400 B ✅
Codex stale shell resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex stale todo list cold open HTTP decoded 72.4 KiB 72.4 KiB 0 B (0.0%) 83.0 KiB ✅
Codex stale todo list cold open rows 75 75 0 (0.0%) 75 ✅
Codex stale todo list cold open nodes 2 2 0 (0.0%) 4 ✅
Codex stale todo list cold open subagents 2 2 0 (0.0%) 4 ✅
Codex stale todo list cold open plans 1 1 0 (0.0%) 2 ✅
Codex stale todo list cold open providerTurns 1 1 0 (0.0%) 2 ✅
Codex stale todo list cold open checkpoints 1 1 0 (0.0%) 2 ✅
Claude short turn resume WebSocket decoded 10.6 KiB 10.6 KiB 0 B (0.0%) 12.7 KiB ✅
Claude short turn resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude long turn running, cold open HTTP decoded 283.3 KiB 283.3 KiB 0 B (0.0%) 302.7 KiB ✅
Claude long turn running, cold open rows 75 75 0 (0.0%) 75 ✅
Claude long turn running, history page HTTP decoded 93.4 KiB 93.4 KiB 0 B (0.0%) 107.4 KiB ✅
Claude long turn running, history page rows 75 75 0 (0.0%) 75 ✅
Claude long turn finished, cold open HTTP decoded 384.2 KiB 384.2 KiB 0 B (0.0%) 410.2 KiB ✅
Claude long turn finished, cold open rows 151 151 0 (0.0%) 151 ✅
Claude long turn finished, socket cold open WebSocket decoded 384.3 KiB 384.3 KiB 0 B (0.0%) 410.2 KiB ✅
Claude long turn finished, socket cold open WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude long turn finished, socket cold open rows 151 151 0 (0.0%) 151 ✅
Claude long turn finished, work page HTTP decoded 188.1 KiB 188.1 KiB 0 B (0.0%) 200.2 KiB ✅
Claude long turn finished, work page rows 150 150 0 (0.0%) 150 ✅
Claude idle thread resume WebSocket decoded 66 B 66 B 0 B (0.0%) 200 B ✅
Claude idle thread resume WebSocket messages 1 1 0 (0.0%) 1 ✅
Claude fleet shell snapshot HTTP decoded 44.1 KiB 44.1 KiB 0 B (0.0%) 53.7 KiB ✅
Claude fleet shell snapshot rows 27 27 0 (0.0%) 27 ✅
Claude fleet shell subscribe WebSocket decoded 66 B 66 B 0 B (0.0%) 200 B ✅
Claude fleet shell subscribe WebSocket messages 1 1 0 (0.0%) 1 ✅
Claude fleet shell resume check HTTP decoded 18 B 18 B 0 B (0.0%) 100 B ✅
Claude fleet shell resume check rows 0 0 0 0 ✅
Claude stale shell reload HTTP decoded 44.1 KiB 44.1 KiB 0 B (0.0%) 53.7 KiB ✅
Claude stale shell reload rows 27 27 0 (0.0%) 27 ✅
Claude stale shell resume WebSocket decoded 140 B 140 B 0 B (0.0%) 400 B ✅
Claude stale shell resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude stale todo list cold open HTTP decoded 73.4 KiB 73.4 KiB 0 B (0.0%) 83.0 KiB ✅
Claude stale todo list cold open rows 75 75 0 (0.0%) 75 ✅
Claude stale todo list cold open nodes 2 2 0 (0.0%) 4 ✅
Claude stale todo list cold open subagents 2 2 0 (0.0%) 4 ✅
Claude stale todo list cold open plans 1 1 0 (0.0%) 2 ✅
Claude stale todo list cold open providerTurns 1 1 0 (0.0%) 2 ✅
Claude stale todo list cold open checkpoints 1 1 0 (0.0%) 2 ✅

Baseline: 7a335d1 · PR result: e72c9cb · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

t3dotgg and others added 6 commits November 30, 2026 22:30
…d finishes (pingdotgg#38864)

agy ends its prompt while a backgrounded command still runs. When the command
finishes, agy starts a reply by itself with no prompt open. T3 Code dropped that
output and failed its permission request, so the thread looked stopped.

The built-in Antigravity adapter and the registry agy path now continue in a new
run, and wait for the reply's closing usage_update instead of the 3 s debounce.
T3 tool titles with the "Run mcp_t3-code_<tool>" form are recognized again, so
html_render pages show.

Takes over pingdotgg#36138, pingdotgg#37485, pingdotgg#30083 and part of pingdotgg#35073.

Co-authored-by: Denis Bolba <[email protected]>
Co-authored-by: drstrangerujn <[email protected]>
Co-authored-by: Vedanta-krit das (Alex Vedmedenko) <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
(cherry picked from commit 12be92d)

Fork port: left out the provider-acp-registry and Hermes changes; T3's Antigravity provider does not use that path.
…and runs, and Stop ends it (pingdotgg#38916)

agy ends its prompt while a command it backgrounded still runs, and replies by
itself when the command finishes. T3 Code ended the run at the prompt, so the
thread looked idle and Stop was not offered.

The run now stays open until the command ends. A daemon does not hold it. Stop
sends session/cancel, which ends the command in agy 1.5.11. A message sent
while the command runs does not, so the command keeps running. A held run
fails when the agent process exits.

The Servers panel no longer lists an agent CLI's own ports.

Takes over pingdotgg#35073 and pingdotgg#36585.

Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: saphid <[email protected]>
(cherry picked from commit f9b9bc7)
…round commands (pingdotgg#39421)

(cherry picked from commit 505f6d6)

Fork port: the fork reads deferFinalizeForBackgroundWork straight from the flavor (no negotiated-flag helper), and the steer test that sat next to this one in upstream is left out.
…ingdotgg#40858)

A turn held open by a background command now ends after 30 quiet minutes, so a command whose
finish never reaches T3 cannot leave the thread in Working forever.

Fork port of upstream 344de5f, applied by hand: the fork lacks
the scheduled-wake hold (pingdotgg#39806) and the prompt-steer refactor that upstream's diff sits in, so
schedules are not held at all here and the scheduled-wake test is left out.
…apter options

Upstream's test imports AntigravityAdapterV2RuntimeInput, which arrived with pingdotgg#36495; the fork does not have that change.
@maschwenk
maschwenk marked this pull request as ready for review December 1, 2026 03:31
@maschwenk
maschwenk force-pushed the fix/antigravity-background-wake branch from ddae99f to e72c9cb Compare December 1, 2026 03:31
@maschwenk
maschwenk merged commit cb2fc3d into main Dec 1, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants