fix(antigravity): pre-approve T3 MCP tools in Auto and Auto-accept edits #39822
Mergedcharlesbine(GitHub profile, opens in a new tab)merged 3 commits into
main fromrefs/pull/39822/headmerged by juliusmarminge View on GitHubcharlesbine(GitHub profile, opens in a new tab) linked this to fix #38806
tanstack-source added labelsbug
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
juliusmarminge added labelstakeover:in-progress
- @@ -183,0 +196,21 @@196+ typeof rawInput.command === "string" ||197+ typeof rawInput.executable === "string")198+ ) {199+ return false;200+ }201+ const title = request.toolCall.title?.trim();202+ if (title !== undefined && /\bacp-mcp-call\b/.test(title)) {203+ return false;204+ }205+ const toolCall = parsePermissionRequest(request).toolCall;206+ if (toolCall === undefined) return false;207+ const { command: _command, ...toolCallWithoutCommand } = toolCall;208+ const mcpToolCall =209+ request.toolCall._meta === undefined210+ ? toolCallWithoutCommand211+ : {212+ ...toolCallWithoutCommand,213+ data: { ...toolCallWithoutCommand.data, meta: request.toolCall._meta },214+ };215+ const identity = extractMcpToolCallIdentity(mcpToolCall);216+ return identity?.server === "t3-code" && T3_MCP_TOOL_NAMES.has(identity.tool);
Pushed9cf4042
juliusmarminge added labelstakeover:needs-julius
juliusmarminge removed labelstakeover:in-progress
juliusmarminge added labelstakeover:ready
juliusmarminge removed labelstakeover:needs-julius
juliusmarminge merged this7966f20
juliusmarminge closed this
juliusmarminge removed labelstakeover:ready
Sign in to join this conversation.


No actionable comments were generated in the recent review.
Walkthrough
Antigravity now identifies T3 MCP permission requests and allows them in
autoandauto-accept-editswhen approval policy is unset or"never". Denials remain in effect, and other requests retain their existing policy behavior.Changes: Antigravity T3 MCP permissions
apps/server/src/provider/acp/AntigravityAcpSupport.tsapps/server/src/provider/acp/AntigravityAcpSupport.ts,apps/server/src/provider/acp/AntigravityAcpSupport.test.tsautoandauto-accept-editswhen approval policy is unset or"never". Tests cover default allowance,"on-request"approval, read-only sandbox denial, and requests that remain subject to approval.Estimated code review effort: 2 (Simple) | ~12 minutes
Change: Bug fix · Severity of issue fixed: Medium
Possibly related PRs
Suggested labels:
bugfixSuggested reviewers:
mkantenko,macroscopeapp,juliusmarmingeMerge Risk:
Minimal · up to
9cf40Antigravity now auto-approves only calls that are identifiably server-qualified T3 MCP calls in Auto and Auto-accept edits modes. Sandbox denials, Supervised mode, explicit approval policies, third-party servers and shell requests still ask. No concrete merge-blocking risk was established.
Pre-merge checks:
4
#38806requires that verified T3-ownedt3-codeMCP calls not prompt in Auto and Auto-accept edits. Supervised and third-party MCP policy stay unchanged. The minimum case is read-only `preview_…isAntigravityT3McpRequesthelper, an allow branch in …Full details: Title check
Explanation
The title names the Antigravity fix and the specific behavior: pre-approving T3 MCP tools in Auto and Auto-accept edits modes. The diff adds a T3 MCP pre-approval branch in antigravityPermissionDisposition and matching tests, so the title matches the main change. It uses the conventional commit form and is specific enough for a teammate scanning history.
Full details: Description check
Explanation
The description follows the template's main sections: Problem, Change, Scope, and Verification. The Problem section states the expected behavior and reproduction context. The Change section explains the gated pre-approval logic and the denial cases. The Scope section links
#38806and states the boundaries. The Verification section lists a failing-test-first run, focused test counts, and a check run with results. It does not link a maintainer request, which the template asks for only when one exists. It also does not include a recording or screenshots, which the template requires only for UI changes. The template's agent-model line is present as 'Created with Gemini 4 Neon in T3 Code.'Full details: Linked Issues check
Explanation
Issue
#38806requires that verified T3-ownedt3-codeMCP calls not prompt in Auto and Auto-accept edits. Supervised and third-party MCP policy stay unchanged. The minimum case is read-onlypreview_status. At the current head (9cf404235d61),antigravityPermissionDispositionin apps/server/src/provider/acp/AntigravityAcpSupport.ts returns "allow" whenisAntigravityT3McpRequestis true, the runtime mode isautoorauto-accept-edits, andapprovalPolicyis undefined or "never". The helper accepts a request in two ways. (1) IfrawInput.ServerNameis present, it requiresServerName === "t3-code"andToolNameinT3_MCP_TOOL_NAMES. (2) IfServerNameis absent andCommandLineis not a string, it matches the titleRun mcp_t3-code_<tool>and requires the tool to be inT3_MCP_TOOL_NAMES. BareRunning <tool>titles are not accepted, which matches the issue's concern about other servers' tools. The issue's Auto-accept edits prompts (t3-code_preview_status,preview_snapshot, and others) therefore fall into the allow path. Two limits apply. The previous review described a different helper body, so that description is stale; the conclusion still holds for the current code. The current helper does not rejectCommandLinewhenServerNameis also present, which differs from the PR text's claim that shell commands can never spoof an MCP call. The issue does not require that check. The test results (48/48, 28/28, check:changed) are author-reported. I did not read the test file, and the diff inspection was unavailable.Full details: Out of Scope Changes check
Explanation
The PR changes apps/server/src/provider/acp/AntigravityAcpSupport.ts and adds tests in AntigravityAcpSupport.test.ts. The source change adds the
isAntigravityT3McpRequesthelper, an allow branch inantigravityPermissionDisposition, and imports ofunknownRecordandT3_MCP_TOOL_NAMES. The helper and branch serve#38806directly. The helper reuses existingT3_MCP_TOOL_NAMESandunknownRecord. Deny, Supervised (approval-required), and explicitapprovalPolicypaths keep their prior dispositions. No unrelated files or exported declarations changed, per the supplied summary. The incremental diff could not be read, so the file-level scope relies on the supplied summary and the current file content.Finishing Touches
Generate unit tests (beta)
4058b8f1-fc54-45f9-9b21-224963e7e06bReviewing files that changed from the base of the PR and between 54ba6d097323f8b16b91c0f631f051ed3d50b1a0 and 9cf404235d61d25f808e4ca41675b67e5804e2ee.
apps/server/src/provider/acp/AntigravityAcpSupport.test.tsapps/server/src/provider/acp/AntigravityAcpSupport.tsIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.