GeezerVison is showing github.com — fix(server): Antigravity agents get the ACP MCP terminal fallback environment by juliusmarminge · Pull Request #38128 · pingdotgg/t3code
Conversation
AntigravityDriver.makeRuntime built the spawned agent's environment from the instance environment only (baseEnv: processEnvironment) and dropped the session's processEnvironment that the shared ACP adapter passes in. That environment carries T3CODE_THREAD_ID and T3_ACP_MCP_NODE/ENDPOINT/AUTHORIZATION/ENTRYPOINT, so the documented acp-mcp-call fallback could not run from Antigravity's shell for the T3 tools Antigravity does not register itself (delegate_task, t3_thread_launch, schedule_task, html_render, preview_*, t3_project_update). The fix takes processEnvironment out of the runtime input (so it is not spread into the ACP session options) and merges it over the instance environment only for buildAntigravityAcpSpawnInput's baseEnv. This matches the Kiro, fx and ACP Registry adapters, which already merge processEnvironment into their spawn env. Antigravity's removedEnvironmentKeys filter still runs over the merged env. Profile preparation and installation lookup still use the instance environment. No new regex or parser.
Fixes #38123
Reproduction on main
Commit: origin/main 758291c. (1) Server run of the env bug: in apps/server/src/provider/Drivers/AntigravityDriver.test.ts I registered an McpProviderSessions entry for a thread, then opened a full session through AntigravityDriver's orchestrationAdapter (openSession + ensureThread), driving the real driver and spawn path against the repo's mock ACP agent. I then read the environment of the spawned agent process. On main the test fails with expected undefined to be 'thread-antigravity-mcp-env': T3CODE_THREAD_ID and T3_ACP_MCP_NODE are missing, so the documented acp-mcp-call fallback cannot run from Antigravity's shell. Temporarily merging input.processEnvironment into baseEnv in AntigravityDriver.makeRuntime made all 7 driver tests pass; I reverted it, and only the test is committed. (2) Schema sizes: I imported every apps/server/src/mcp/toolkits/*/tools.ts and serialized {name, description, parameters: advertisedJsonSchema(tool)} for each of the 83 tools. The tools over 1,280 B are schedule_task 3318, t3_thread_launch 2611, delegate_task 1937, html_render 1668, preview_act 1599, t3_project_update 1541, preview_open 1521 and preview_navigate 1296. The largest below is create_threads at 1242. Seven sizes match the report exactly; preview_act is 1599 against the reported 1629. (3) Not verified: Antigravity's own ~1,280 B eager cutoff and the missing call_mcp_tool. Both live inside the antigravity binary, which no VM has.
Evidence
Being captured: before and after in the real app. This section is filled in before the pull request can merge.
Tests
vp test run src/provider/Drivers/AntigravityDriver.test.ts src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts (apps/server): 2 files, 22 tests passed. The same driver test without the fix (stashed) fails with 'expected undefined to be thread-antigravity-mcp-env', as on the repro branch. vp run check:changed: format, lint, knip, graphql, typecheck (3 packages) and tests (3 files, 24 tests) all pass.
Not in this change
- Shrinking T3 MCP tool schemas (delegate_task 1937 B, schedule_task 3318 B, t3_thread_launch, html_render, preview_act/open/navigate, t3_project_update) below Antigravity's reported ~1,280 B eager-registration cutoff. This is model-facing text that needs the evals/ workflow, and the cutoff itself is unverified.
- T3_CODE_ACP_MCP_FALLBACK_INSTRUCTIONS says to use the terminal fallback 'if the T3 tools are absent'. With only some tools registered, the agent might not realise it should fall back for the missing ones. Rewording it is a model-facing text change.
- Antigravity's own missing call_mcp_tool and its ~1,280 B cutoff are inside the antigravity binary, which no VM has, so they are not verified here.
- Open PRs fix(antigravity): thread sessions spawn with their T3 thread and MCP environment #36495 and fix(antigravity): defer T3 MCP tools and forward session MCP env #37886 make the same environment fix and would conflict with or duplicate this one.
Who did the work
- Written by Claude Opus 5.5, in Claude Code
- Reviewed by GPT-6.1 Sol, in Codex, and by Claude Opus 5.5, each on its own
- Proof captured by GPT-6.1 Sol and checked by Claude Opus 5.5
Run by the t3code factory in T3 Code.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Fails on main: AntigravityDriver.makeRuntime builds the agent's env from
the instance environment only, so the spawned agent never receives
T3CODE_THREAD_ID or T3_ACP_MCP_NODE and the acp-mcp-call fallback for
tools Antigravity does not register cannot run (#38123).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ironment
AntigravityDriver.makeRuntime built the agent's environment from the
instance environment only and dropped the session's processEnvironment,
so the spawned agent never received T3CODE_THREAD_ID or the
T3_ACP_MCP_* variables. Tools Antigravity does not register natively
could then not be reached through acp-mcp-call from its shell.
Merge the session environment over the instance environment for the
agent spawn, as the Kiro, fx and ACP Registry adapters already do.
Fixes #38123
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 |
42.4 KiB |
42.4 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 |
42.4 KiB |
42.4 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 |
43.0 KiB |
43.0 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 |
43.0 KiB |
43.0 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: 1da3f3f · PR result: db716dc · 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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Approvability
Verdict: Approved at db716dc
Macroscope's review found this PR approvable — Antigravity agents now inherit the existing ACP session environment so terminal-based MCP fallback can work. The change is limited to agent spawning and preserves existing environment filtering and profile setup.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
The automated pipeline stopped on this pull request and will not merge it:
the fix is written and reviewed, but proving it needs something no worker has:
- Permanent blocker: Antigravity, preferably the reported version 1.5.9, is required to demonstrate dropped tool registration and execute the acp-mcp-call shell fallback in a real Antigravity thread. The brief explicitly lists Antigravity as unavailable on every VM. Replay speaks generic ACP and cannot establish this behavior.
- The base failure and head success for the fallback environment and actual MCP tool calls remain unverified in the real app.
It stays open for a person to finish or close.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
The Antigravity runtime accepts an optional per-session process environment. The driver merges it with its process environment, with session values taking precedence. A test checks that the launched process receives the thread ID and a nonempty MCP node value.
Changes: Antigravity environment forwarding
| Layer / File(s) |
Summary |
Merge session environment and verify launch apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.ts, apps/server/src/provider/Drivers/AntigravityDriver.ts, apps/server/src/provider/Drivers/AntigravityDriver.test.ts |
The runtime input adds optional processEnvironment. The driver merges these values over its process environment for the spawned process. The test registers an MCP session, opens and ensures a thread, and checks the launched process environment. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Possibly related PRs
- pingdotgg/t3code#37886: It also forwards per-session MCP environment variables through the Antigravity driver.
Suggested labels: bugfix
Suggested reviewers: t3dotgg, maria-rcks, macroscopeapp
Merge Risk: Minimal · up to db716
-
Antigravity agent sessions now receive the thread ID and MCP environment values that the fallback tool needs. The change is small and covered by a test, so no merge-blocking risk remains.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the fix and its scope: Antigravity agents receive the ACP MCP terminal fallback environment. The changeset merges the session processEnvironment into the spawn environment in Antigravi… |
| Description check |
 |
The description follows the template sections. Problem explains the dropped processEnvironment and the broken acp-mcp-call fallback, and cites issue #38123. Change explains the merge and why it matche… |
| Linked Issues check |
 |
Directly linked issue #38123 accepts either schema compaction or preserving the session environment for the acp-mcp-call fallback (its Expected behavior uses 'either ... and/or'). This PR implements t… |
| Out of Scope Changes check |
 |
The reviewed diff from merge base 758291c to head db716dc has two source hunks and a test change. Both source hunks connect directly to issue #38123: the driver env merge in AntigravityDrive… |
Full details: Title check
-
Explanation
The title names the fix and its scope: Antigravity agents receive the ACP MCP terminal fallback environment. The changeset merges the session processEnvironment into the spawn environment in AntigravityDriver.makeRuntime, which matches the title. It follows the conventional commit form and is specific enough for a teammate scanning history.
Full details: Description check
-
Explanation
The description follows the template sections. Problem explains the dropped processEnvironment and the broken acp-mcp-call fallback, and cites issue #38123. Change explains the merge and why it matches the Kiro, fx and ACP Registry adapters. Scope links the issue and explains the bug-fix scope. Verification lists focused tests, repro results, and a check:changed run. It also states what is not covered. The Evidence section says it is still being captured and must be filled before merge, so the description is not fully complete. The model and harness attribution is present.
Resolution
Complete the Evidence section with the before and after results from the real app, or state that no UI change applies and remove the placeholder text before merge.
Full details: Linked Issues check
-
Explanation
Directly linked issue #38123 accepts either schema compaction or preserving the session environment for the acp-mcp-call fallback (its Expected behavior uses 'either ... and/or'). This PR implements the environment path. In apps/server/src/provider/Drivers/AntigravityDriver.ts, makeRuntime now destructures input.processEnvironment into sessionEnvironment, removes it from the runtime input, and passes baseEnv: { ...processEnvironment, ...sessionEnvironment } to buildAntigravityAcpSpawnInput. The session values override the instance values for duplicate keys. This supplies T3CODE_THREAD_ID and T3_ACP_MCP_* to the spawned agent, which the issue identifies as missing. In apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.ts, the makeRuntime input type gains an optional processEnvironment. The PR reports a driver test that fails without the fix and passes with it. Schema-size reduction is not implemented here. The issue does not require it when the environment path is used. The issue's proposed unit assertion on schema byte length is also not present, but it is a suggestion, not an acceptance criterion. Antigravity's binary-level cutoff and call_mcp_tool are unverified, as the PR states.
Full details: Out of Scope Changes check
-
Explanation
The reviewed diff from merge base 758291c to head db716dc has two source hunks and a test change. Both source hunks connect directly to issue #38123: the driver env merge in AntigravityDriver.ts and the matching optional processEnvironment type in AntigravityAdapterV2.ts. The test change described in the summary supports the environment objective. No unrelated files or behavior changes were shown. The PR description's Evidence section is an unfilled placeholder. This is a process gap, not a code change, and it does not affect scope.
Finishing Touches
-
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between 1da3f3f and db716dc.
Files selected for processing: 3
-
apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.ts
apps/server/src/provider/Drivers/AntigravityDriver.test.ts
apps/server/src/provider/Drivers/AntigravityDriver.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks for this. Main has the change since #36495.
Compared the full diff of #38128 with the merge: main now accepts the thread processEnvironment, removes it from runtime options, and merges it over the instance spawn environment, with regression coverage for all five thread/MCP variables and unchanged non-thread launches.
Closing as superseded.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:S
10-29 changed lines (additions + deletions).
vouch:trusted
Author is trusted by repo permissions or the VOUCHED list.
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|