Problem#
Below Full access, pull_request_create on the Antigravity provider fails at once with "The person declined to run this repository's push hooks. Nothing was pushed and no PR was opened." No prompt is ever shown, and calling again fails the same way (#44417).
Two things combine in the report:
- Antigravity reaches
pull_request_create through the tool_call proxy over the sessionless MCP protocol. For a sessionless request the proxy gives the nested tool a stand-in McpServerClient that still carries the caller's elicitation capability, but its getClient dies. McpClientInput.askApproval takes the stand-in for a live session, the attempt to use it crashes, and the crash is read as the person's decline.
- husky 9 and Vite+ install the same dispatcher shim for each hook name they know. A repository that defines only
pre-commit still has .vite-hooks/_/pre-push, and readPushHooks counted that do-nothing shim as a push hook to ask about.
Change#
apps/server/src/mcp/McpHttpServer.ts: the tool_call stand-in no longer claims elicitation. The proxied tool sees a client that cannot be asked and takes the path docs/user/permission-modes.md already documents for it: push with hooks off and tell the agent. Session-based clients keep their real client and are asked as before.
apps/server/src/vcs/GitVcsDriverCore.ts: a hook file that is exactly the shim is left out when the script it names is missing and the runner h beside it starts with the known husky 9.1 / Vite+ lines that exit before running anything. Any other runner, a missing runner, or a shim whose script exists is still a hook. The script path is now worked out the way the runner does it, so a hooks path ending in .. checks the directory the runner would.
docs/internals/04_environment-auth.md: both behaviours.
A left-out shim is never started: with no hook left the push runs with core.hooksPath=/dev/null, and an approved push only has launchers for the approved hooks. A wrong "no hook" verdict can therefore skip a hook, never run unapproved code.
Both changes are needed for the one failure in #44417: the shim change removes the needless request in the reported repository, and the tool_call change removes the false decline for repositories that do define a pre-push script.
Scope#
Bug fix for #44417.
Related: #44439 by juliusmarminge fixes the shim half with a smaller rule (a shim with no script is no hook, whatever the runner contains) and lists the Antigravity decline under "Not in this change". This PR overlaps with it in readPushHooks and will need a rebase if #44439 merges first. Two things here may be useful to #44439 either way:
- Its note says
agy answers the elicitation itself over an MCP session. Probing agy 1.5.18 against a local HTTP MCP server showed otherwise for T3 Code's case: when server/discover is answered with supportedVersions including 2026-07-28, agy stays sessionless and sends io.modelcontextprotocol/clientCapabilities: { elicitation: { form: {}, url: {} }, roots: … } with every request. It only sent initialize and opened a session when discovery was answered wrongly. Sessionless through tool_call is the stand-in path fixed here.
- The script path
path.dirname(hooksDir) does not match the runner's dirname "$(dirname "$0")" when core.hooksPath ends in ... With core.hooksPath = a/b/.., a real git push ran a/b/pre-push, while the code looked one level above a/.
Not in this change: Antigravity is still never shown the approval prompt, so below Full access its pushes skip real push hooks and say so. Showing the prompt would need tool_call to carry the request and the reply, and the ACP adapter to render an empty consent form.
Verification#
How it was found: reading the path from pull_request_create to McpClientInput.askApproval, then reproducing each half in a test.
vp test run src/mcp/McpHttpServer.test.ts -t "a tool asks a sessionless client": the test now also calls the asking tool through tool_call on a 2026-07-28 client that declares elicitation. Without the fix it returns declined; with it, unavailable.
vp test run src/vcs/GitVcsDriverCore.test.ts -t "shim": against real Git repositories. Without the fix pushHooks reports the shim and its runner where null is expected. With it: the husky and Vite+ runners give null and the push goes through; a runner that does something first, a missing runner, a defined script, and a script under a hooks path ending in .. all stay hooks. The .. assertion fails with the old path computation.
- A second test approves a real
pre-push script that writes the reference-transaction script during the push, with that hook's shim installed: only pre-push runs.
sh .vite-hooks/_/pre-push in this repository (Vite+ shim, no pre-push script) exits 0 and prints nothing.
vp run check:changed: format, lint, knip, graphql, typecheck (3 packages), tests (3 files, 453 passed). The other suites that touch this code (GitManager, worktreeCheckoutCache, TaskFolders, AcpMcpStdioBridge, AntigravityAdapterV2, pull-request handlers) pass: 348 tests.
Not checked: a run in the real app on an Antigravity thread. The evidence for that path is the agy probe above plus the transport-level test.
Written by Claude Fable 5.2 in Claude Code, run in T3 Code. Reviewed by Claude Opus 5.5, GPT-6.1 Sol and Gemini 4 Neon, each on its own.
🤖 Generated with Claude Code
No actionable comments were generated in the recent review.
Walkthrough
Push-hook discovery now distinguishes recognized inert Husky and Vite+ shims from hooks that run scripts. MCP approval handling now returns unavailable when a thread’s provider cannot show requests. The fallback MCP client excludes elicitation capabilities.
Changes: Push-hook and MCP approval behavior
apps/server/src/vcs/GitVcsDriverCore.ts,apps/server/src/vcs/GitVcsDriverCore.test.ts,docs/internals/04_environment-auth.md_/up/.., approval invalidation, and a script created during a push. The documentation describes the runner and script checks.apps/server/src/mcp/McpClientInput.ts,apps/server/src/mcp/toolkits/pullRequests/handlers.test.ts,docs/internals/04_environment-auth.mdunavailablewhen the provider instance does not show requests. Tests cover provider sessions and adapters that do not show requests. The documentation describes the reply rule.apps/server/src/mcp/McpHttpServer.ts,apps/server/src/mcp/McpHttpServer.test.ts,docs/internals/04_environment-auth.mdtool_call-routed requests, with approval unavailable on the proxy path. The documentation lists cases where elicitation requests are not available.Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: Medium
Possibly related issues
Suggested reviewers:
juliusmarmingeMerge Risk:
Minimal · up to
5e7d9This change makes pushes below Full access fall back to hooks-off for adapters that cannot show approval prompts, instead of reporting a false decline. It also stops inert Husky and Vite+ shims from being treated as push hooks. The reviewed paths show no concrete merge-blocking risk.
Pre-merge checks:
4
Full details: Title check
Explanation
The title names the Antigravity pull_request_create failure with a push-hook decline that no one gave, and it is a fix(server) conventional commit. The changeset matches this. It changes the tool_call stand-in client to drop elicitation, and it changes readPushHooks to ignore husky 9.1 and Vite+ shims whose scripts are missing. The title covers the main user-visible symptom. It does not name the shim fix, but that is expected for a single title.
Full details: Description check
Explanation
The description follows the template: Problem, Change, Scope, and Verification are all filled in with specific content. The Problem gives the symptom, the reproduction path, and the issue number. The Change lists each file and explains why both halves are needed. The Scope links issue
#44417and a related PR. The Verification gives focused test commands, observed results, and items not checked. The author also names the model and harness, as the template requests. The title follows the conventional commit guidance. The description is complete. Minor point: the template asks for solving one underlying problem, and the PR has two causes, but the author justifies why both changes are needed for the same fix.Finishing Touches
Generate unit tests (beta)
4f468cef-c962-48a5-b448-ce20ba868602Reviewing files that changed from the base of the PR and between 41b1e6bf995d2a40b872fbd7947817740e78beba and 5e7d9322fc5cfe5e8af70e02e7fd56aebc2dea38.
apps/server/src/mcp/McpClientInput.tsapps/server/src/mcp/McpHttpServer.test.tsapps/server/src/mcp/toolkits/pullRequests/handlers.test.tsdocs/internals/04_environment-auth.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.