#4445: fix: resolve Antigravity "unsupported version" and tool_use schema validation errors
agents
Cluster:
Security Enhancements and Fixes
Problem:
The hardcoded version 1.11.x caused "version no longer supported" errors on the 2026-01-29 gateway update.
The 1.15.8 API now strictly enforces the presence of the input field in tool_use payloads, leading to Field required crashes.
Solution:
Updated version strings to antigravity/1.15.8 across the Google Provider.
Refactored tool-use logic to ensure a mandatory input object (even if empty) is always included in the payload.
Verified on M2 Mac with Node v25.5.0.
Verification:
openclaw doctor confirmed as valid.
Tested complex tool calls without schema errors.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates Antigravity integration to avoid recent gateway failures by:
- Bumping the hardcoded Antigravity `User-Agent` version (including via a pnpm patch to `@mariozechner/pi-ai`).
- Adding a transcript sanitizer (`sanitizeToolUseInput`) and updating Google session history sanitization/tests so tool-related blocks always include a required `input` object.
These changes sit in the Pi embedded runner’s transcript hygiene path (`src/agents/pi-embedded-runner/google.ts`), ensuring messages are shaped to match the stricter 1.15.8 schema before being sent to Google/Antigravity.
<h3>Confidence Score: 3/5</h3>
- This PR is close to safe to merge, but there is a high-impact edge case where tool-result messages may still violate the stricter tool_use schema.
- Most changes are straightforward (UA bump + sanitizer + tests). However, the new sanitizer filters on `msg.role` and will not touch `toolResult` messages, even though transcript tool blocks can appear there; if the upstream schema enforcement applies to those blocks too, the original crash may persist in some sessions. Also, adding a pnpm patched dependency increases the surface area slightly and warrants a quick verification run in CI.
- src/agents/pi-embedded-helpers/google.ts; verify_logic.mjs; package.json/pnpm-lock.yaml (patched dependency wiring)
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#5210: Fix Antigravity server side checks and returning Version error
by Ivorisnoob · 2026-01-31
84.5%
#22214: fix(tools): sanitize google-antigravity schemas for Gemini-compatib...
by Kansodata · 2026-02-20
83.7%
#21835: fix: apply schema cleaning for google-antigravity in normalizeToolP...
by ephraimm · 2026-02-20
82.4%
#5064: fix(auth): update deprecated User-Agent headers
by mfortin014 · 2026-01-31
81.3%
#7382: fix: remove config.schema from agent gateway tool
by kakuteki · 2026-02-02
79.7%
#8312: fix: add logging and markers for tool result repair
by ekson73 · 2026-02-03
79.4%
#21195: fix: suppress orphaned tool_use/tool_result errors after session co...
by ruslansychov-git · 2026-02-19
79.3%
#22321: fix: sanitize tool schemas for all Cloud Code Assist providers
by Sr-0w · 2026-02-21
79.1%
#11825: fix: keep tool_use/tool_result pairs together during session compac...
by C31gordon · 2026-02-08
79.0%
#14328: fix: strip incomplete tool_use blocks from errored/aborted messages...
by Kropiunig · 2026-02-12
79.0%