Skip to content

fix(antigravity): compact MCP schemas on the stdio bridge - #3

Draft
Harold Hunt (huntharo) wants to merge 1 commit into
test/model-request-benchmarkfrom
fix/antigravity-tool-loading
Draft

Harold Hunt (huntharo) wants to merge 1 commit into
test/model-request-benchmarkfrom
fix/antigravity-tool-loading

Conversation

@huntharo

@huntharo Harold Hunt (huntharo) commented Nov 25, 2026 •

Copy link
Copy Markdown

Problem

Antigravity’s stdio MCP bridge sends full argument schemas for every listed T3 tool up front. The pinned CLI fixes the callable tool names for the active turn, so removing declarations wholesale would make those tools unreachable during that turn.

Change

  • The default Antigravity stdio catalog keeps all available T3 tool names and descriptions. It keeps full schemas for orchestrator_capabilities, delegate_task, task_status, and tool_search. Other declarations use a generic object schema. Exact-name tool_search supplies the original argument schema, and the MCP server validates calls against it.
  • The opt-in T3CODE_ANTIGRAVITY_THEME_BROKER=1 catalog advertises the three core tools directly, plus tool_search and call_t3_tool. It omits the native t3_theme_read declaration and exposes that read as the broker’s sole target. Discovery and execution reuse the thread’s scoped MCP credential. Antigravity’s Supervised approval and the target’s server-side validation still apply.
  • The transport tests cover Antigravity’s HTTP-first path and stdio fallback. The compact catalog and broker are specific to its stdio bridge.

Scope

Product and product tests only. Stacked on pwrdrvr/t3code#2. The request-size problem overlaps upstream issue #38123 and the open proxy proposal #39362.

Verification

Authenticated WebSocket runs used pinned agy 1.5.16, Gemini 3.1 Pro Preview at low effort, macOS arm64, fresh synthetic state and a loopback model endpoint. Totals are outbound request-body bytes across all primary and auxiliary calls. Each column uses the same prompt across the three configurations. The theme turn uses the native read in the stock and compact configurations and discovery plus the broker in the opt-in configuration.

Catalog No-tool first turn (bytes / calls) No-tool follow-up (bytes / calls) Theme-read turn (bytes / calls)
Stock on #2 169,660 / 2 163,141 / 1 337,485 / 3
Compact (default) 138,756 / 2 132,237 / 1 275,677 / 3
Theme broker (opt-in) 83,603 / 2 77,084 / 1 244,410 / 4

The theme broker was advertised on every primary model request in the turn, and the native theme declaration was absent. Search returned the full theme schema and the approved broker call returned the real handler result in the same T3 turn. Declining the broker call prevented execution. A numeric themeId failed target validation, and t3_theme_set was rejected.

The focused product and MCP eval-grader run passed 1,427 tests across 12 files, including the generic ACP adapters and MCP access checks. vp run check:changed 3ffb0cadc208c12ef19732fbcf6b50ef6321a10d passed, including typechecks for 27 affected packages. The MCP tool-use context check and four theme dry runs completed locally. Credentialed model evals were skipped because they call real providers.

Implemented with GPT-6 on Codex.


Proof this PR
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

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

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

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

Other scenarios

No main baseline exists yet for these 64 scenario measurements.

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

Baseline: unavailable · PR result: bc39784 · 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.

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.

1 participant