Two Antigravity problems left after #38864:
- The thread showed idle while a command ran. 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 and marked the command completed. The thread looked stopped until the reply started a second run, and Stop was not offered.
- Every Antigravity thread listed two servers. They were agy's own loopback ports, not servers the agent started.
Fixes #16442. Fixes #38868.
Fix#
- A run stays open while a command the agent waits for still runs. The command row shows running, and the reply lands in the same run.
- A daemon (
IsDaemon: true) does not hold the run, because it may never end. When one exits, the continuation from #38864 still reports it.
- Stop sends
session/cancel, which ends the command in agy 1.5.11. A message sent while the command runs does not send it, so the command keeps running.
- A held run fails when the agent process exits. No prompt is open then, so nothing else reported it.
- The Servers panel skips a listener that is the agent CLI itself (a direct child of the server). Servers that the agent's commands start are still listed.
No process-group teardown is needed. Captures from agy 1.5.11 show that session/cancel ends a background command even with no prompt open, and that killing the agy process does not end it, because each command is its own session leader.
Other providers do not change: the new behavior is behind a flavor hook that only the built-in Antigravity adapter sets.
Proof#
Real agy 1.5.11 through vp run dev:
- Held run: one run stayed running for a 20 s background command, the command row went from running to completed, then the run completed. Before, this was two runs with an idle gap.
- Stop: with
sleep 240 running after the prompt ended, Stop ended the process, and the run and the command row showed interrupted. agy stayed alive.
- Message while a command runs: the command kept running, the agent answered the message, and a follow-up run reported the command output when it finished.
- Servers panel: only the
python3 -m http.server that agy started is listed.
| Run stays open, Stop is offered | Servers panel lists only the real server |
|---|
 |  |
Before, for the Servers panel (from #38864's proof, two Agent · antigravity rows): 
Tests:
AntigravityAdapterV2.test.ts: the run stays open and ends in one run; Stop sends one cancel; a new message sends none; the agent exiting fails the run. Each case fails without its part of the fix.
PortScanner.test.ts: the agent CLI's own listener is not listed, on Linux and macOS.
vp run check:changed passes. vp test run src/orchestration-v2/Adapters src/preview src/provider/acp: 33 files pass.
Credit#
This PR takes over two open PRs for #16442:
- #35073 by @juliusmarminge: keep the turn open for a running command, and the test direction.
- #36585 by @saphid: fail a held turn when the runtime dies.
Their process-group and macOS libproc teardown is not included, because session/cancel already ends the command.
Known limits:
- A daemon row is still marked completed when the run ends, and Stop cannot end a daemon after the run.
- A message sent while a command runs marks that command row interrupted until the command finishes. The command itself keeps running.
- The registry
agy path keeps the #38864 behavior (the run ends, then a continuation run).
- An agent launched through a wrapper process still lists its own ports.
Reviewed with sol-loop: 2 passes with GPT-6.2 Sol. Sol verdict: approved
Created with Claude Fable 5.2 in Claude Code, running in T3 Code.
🤖 Generated with Claude Code
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Other scenarios#
All 64 scenario measurements match
main.All 64 scenario measurements
short turn resumeWebSocket decodedshort turn resumeWebSocket messageslong turn running, cold openHTTP decodedlong turn running, cold openrowslong turn running, history pageHTTP decodedlong turn running, history pagerowslong turn finished, cold openHTTP decodedlong turn finished, cold openrowslong turn finished, socket cold openWebSocket decodedlong turn finished, socket cold openWebSocket messageslong turn finished, socket cold openrowslong turn finished, work pageHTTP decodedlong turn finished, work pagerowsidle thread resumeWebSocket decodedidle thread resumeWebSocket messagesfleet shell snapshotHTTP decodedfleet shell snapshotrowsfleet shell subscribeWebSocket decodedfleet shell subscribeWebSocket messagesfleet shell resume checkHTTP decodedfleet shell resume checkrowsstale shell reloadHTTP decodedstale shell reloadrowsstale shell resumeWebSocket decodedstale shell resumeWebSocket messagesstale todo list cold openHTTP decodedstale todo list cold openrowsstale todo list cold opennodesstale todo list cold opensubagentsstale todo list cold openplansstale todo list cold openproviderTurnsstale todo list cold opencheckpointsshort turn resumeWebSocket decodedshort turn resumeWebSocket messageslong turn running, cold openHTTP decodedlong turn running, cold openrowslong turn running, history pageHTTP decodedlong turn running, history pagerowslong turn finished, cold openHTTP decodedlong turn finished, cold openrowslong turn finished, socket cold openWebSocket decodedlong turn finished, socket cold openWebSocket messageslong turn finished, socket cold openrowslong turn finished, work pageHTTP decodedlong turn finished, work pagerowsidle thread resumeWebSocket decodedidle thread resumeWebSocket messagesfleet shell snapshotHTTP decodedfleet shell snapshotrowsfleet shell subscribeWebSocket decodedfleet shell subscribeWebSocket messagesfleet shell resume checkHTTP decodedfleet shell resume checkrowsstale shell reloadHTTP decodedstale shell reloadrowsstale shell resumeWebSocket decodedstale shell resumeWebSocket messagesstale todo list cold openHTTP decodedstale todo list cold openrowsstale todo list cold opennodesstale todo list cold opensubagentsstale todo list cold openplansstale todo list cold openproviderTurnsstale todo list cold opencheckpointsBaseline:
455a60a· PR result:0d9973d· Source CI: successScenario 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.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.