Skip to content

fix(antigravity): keep subagent batches active after launch - #9579

Merged
t3dotgg merged 1 commit into
mainfrom
t3code/investigate-antigravity-subagents
Sep 4, 2026
Merged

fix(antigravity): keep subagent batches active after launch#9579
t3dotgg merged 1 commit into
mainfrom
t3code/investigate-antigravity-subagents

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Sep 4, 2026

Copy link
Copy Markdown
Member

Antigravity marked subagents done as soon as start_subagent returned, even while the children were still running. One call can launch several children, and its output is a launch description.

Show each launch as an Antigravity subagent batch. Keep it active for the parent turn, then mark it idle with an explanation that individual agent status is unavailable. Preserve launch failures, cancellation, disconnect handling, and history replay. The shared client fold now displays that status explanation.

Google's current ACP stream omits individual child status, names, and reply ownership. This fixes the false completion and batch label. It cannot provide separate child entries or separate their replies from the parent conversation. The provider docs describe these limits.

Validation:

  • 195 focused tests passed across the adapter, protocol, shared subagent state, and mobile work log.
  • Server and shared-client typechecks, targeted lint, and formatting passed.
  • An isolated run through the official ACP binary launched two agents. The launch returned in 3 ms. The updated adapter kept the batch running through three later child tool completions, then marked it idle when the parent turn ended. It emitted no subagent completion event.
  • Browser replay verification confirmed the batch lifecycle. It exposed remaining summary labels, fixed in #9616, which includes before/after screenshots.

Created with GPT-6 Astra (preview) in Codex.


Note

Medium Risk
Changes Antigravity subagent event semantics (running vs completed vs idle) that drive Agents UI and work log; behavior is heavily tested but affects user-visible task state.

Overview
Fixes Antigravity treating start_subagent as finished when the launch tool returns, even though one launch can start several agents and its output is only a launch description—not child results.

Antigravity adapter now models each launch as Antigravity subagent batch: it stays running through launch completion and sibling child tool activity, emits task.progress with the launch description, and only emits task.completed on real failed launches (including replayed history). Normal turn end settles open batches to idle via task.updated with an explanation and timelineBypass, instead of interrupted or a fake completion. Historical launches without an active turn get a similar idle update; late updates after settlement are ignored. antigravitySubagentResult is renamed to antigravitySubagentOutput.

Shared client foldSubagentActivities applies detail from task.updated to agent progress, so the idle message shows in Agents / work log. User docs describe batch behavior and ACP limits (no per-child status or separate entries).

Tests were rewritten/added across the adapter, protocol, and subagent fold to match this lifecycle.

Reviewed by Cursor Bugbot for commit 6b05620. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Keep Antigravity subagent launches active as idle batches after turn end

  • Active native start-subagent calls are now treated as batch launches that stay running during the parent turn instead of being reported as completed child results. Failed launches still complete with bounded output.
  • When a parent turn ends normally, finishSubagents in AntigravityAdapter.ts settles unfinished batch tasks as idle rather than interrupted, adds an "individual agent status unavailable" message, and marks the update for timeline bypass. Cancelled and failed settlements retain their statuses.
  • The turn settlement handler no longer synthesizes a missing-result error for normally completed turns with unfinished subagent work; only provider-supplied turn errors are forwarded.
  • foldSubagentActivities in subagentRuntime.ts now reads a non-empty detail field from task.updated activities and stores it as bounded progress text.
  • Behavioral Change: subagentLinkage task titles changed from the individual-subagent label to the batch label; normal turn-end status changed from interrupted to idle; completed historical launches now emit task.updated (idle) instead of task.completed.

Macroscope summarized 6b05620.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.8 KiB 13.8 KiB +3 B (+0.0%) 15.1 KiB
Codex Thread snapshot wire 7.0 KiB 7.0 KiB −5 B (−0.1%) 7.3 KiB
Codex Live turn WebSocket wire 6.7 KiB 6.7 KiB +8 B (+0.1%) 7.8 KiB
Codex Live turn WebSocket decoded 58.5 KiB 58.5 KiB 0 B (0.0%) 66.4 KiB
Codex Live turn messages 10 10 0 (0.0%) 21
Claude Total thread wire 13.6 KiB 13.7 KiB +161 B (+1.2%) 15.1 KiB
Claude Thread snapshot wire 7.0 KiB 7.0 KiB −4 B (−0.1%) 7.3 KiB
Claude Live turn WebSocket wire 6.5 KiB 6.7 KiB +165 B (+2.5%) 7.8 KiB
Claude Live turn WebSocket decoded 57.9 KiB 59.3 KiB +1.4 KiB (+2.5%) 66.4 KiB
Claude Live turn messages 10 10 0 (0.0%) 21

Baseline: 0cb02ab · PR result: 6b05620 · 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: 113.8 KiB
  • Claude decoded thread snapshot: 114.5 KiB

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

@macroscopeapp

macroscopeapp Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 6b05620

Macroscope's review found this PR approvable — This is a narrowly scoped Antigravity lifecycle fix that keeps batch entries active until the parent turn ends, accurately represents unavailable child status, and ignores stale updates. The production impact is confined to subagent task-state presentation, with focused tests covering the revised behavior.

You can add or adjust custom eligibility rules. Learn more.

@t3dotgg
t3dotgg merged commit 2675e3c into main Sep 4, 2026
23 checks passed
@t3dotgg
t3dotgg deleted the t3code/investigate-antigravity-subagents branch September 4, 2026 03:29
sheehanmunim added a commit to munimtechnologies/mtcode that referenced this pull request Sep 4, 2026
…tlebar, auth refresh, wordmark)

Brings the fork up to upstream/main f559fe0. Small fixes batch: desktop
panel titlebar interactions (pingdotgg#9591), Connect auth refresh without disconnect
(pingdotgg#9582), sidebar wordmark baseline alignment (pingdotgg#9578), right panel transitions
(pingdotgg#9554), settings sidebar rendering (pingdotgg#9562, pingdotgg#9563), codex restart continuity
(pingdotgg#9560), contributor vouching (pingdotgg#9557), usage proxy dedup (pingdotgg#9584), mobile
markdown images (pingdotgg#8769), antigravity subagent batches (pingdotgg#9579), shell label
syntax (pingdotgg#9371), context meter in compact composer (pingdotgg#9430), disconnected-send
toasts (pingdotgg#9592).

Resolutions (keep-both unless noted):
- ChatComposer: fork voice-session button + showSecondaryStatus kept.
- SettingsSidebarNav: fork MT Teams badge + avatar box kept; upstream Suspense
  wrappers adopted.
- SidebarChrome: fork BrandWordmark kept inside upstream's baseline-aligned
  wordmark row.
- supervisor: upstream fiber-based establishment + replacement loop win (fork
  branches superseded by the auth-refresh rework).

Fork guard script OK.
@t3dotgg

t3dotgg commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

Note

🤖 GPT-6 Astra (preview) responding on behalf of Theo

Browser verification confirmed that batches stay active after launch and become idle when the parent turn ends. It found a remaining mismatch: the conversation summary still said completed while Agents showed idle.

PR #9616 fixes that summary, counts launches as batches, and preserves the inactive status explanation on mobile. It includes before/after screenshots from isolated fixtures generated by replaying recorded ACP traffic through the adapters.

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

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant