GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(google): comprehensively eliminate Antigravity request-shape 400s by HaydernCenterpoint · Pull Request #309 · lidge-jun/opencodex

Conversation

@HaydernCenterpoint

@HaydernCenterpoint HaydernCenterpoint commented Jul 23, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Summary

This introduces a single conservative wire compiler for every Google-family request and comprehensively fixes the known Antigravity 400 invalid request class caused by request-shape incompatibilities.

  • Compile AI Studio, Vertex, and Cloud Code Assist payloads through one final trust boundary before serialization.
  • Normalize arbitrary MCP / JSON Schema input into Google's supported function-schema subset, including x-mcp-header, draft 2020-12 annotations, nullable anyOf, local refs, hostile values, and recursion limits.
  • Clamp unsupported Antigravity thinking levels (xhigh, max, ultra) to Google's highest accepted high value.
  • Normalize invalid, long, or colliding tool names and restore the original name when the model calls the tool.
  • On a provider schema/thinking 400, rebuild a materially changed request and replay it exactly once; unrelated 400 responses remain non-retryable.

Root cause

Google request compatibility was previously enforced incrementally while building the payload. There was no final compiler guaranteeing wire invariants, so one provider-specific field or one third-party MCP schema could invalidate the entire tool catalog. The transport also treated every 400 as terminal even when the provider identified a safely repairable schema or thinking field.

Why this is comprehensive for Antigravity request-shape failures

The strict allowlist prevents unknown third-party schema keywords from reaching Antigravity, while the final compiler also covers generation config and tool-name constraints. If the Claude bridge still rejects a documented construct, the targeted open-schema fallback repairs the named tool and replays once. This closes the observed thinking_level=max, x-mcp-header, Serena nullable-union, and generic tools.N.custom.input_schema failure modes without depending on Serena or any specific MCP server.

This scope intentionally does not claim to suppress authentication, quota, permission, network, or upstream availability failures; those are separate provider conditions rather than malformed-request bugs.

Impact

  • A single malformed MCP tool can no longer poison every tool in the request.
  • Users without Serena are unaffected; all MCP catalogs receive the same provider-boundary normalization.
  • Other providers are unchanged.
  • No new dependency is added.

Validation

  • bun run typecheck
  • 128 Google / Vertex / Antigravity tests passed across 10 files.
  • Full local suite: 3453 passed, 4 skipped; the only 2 failures are the existing Windows Cursor printf fixtures.
  • Live isolated-dev E2E against Antigravity: 112 tools (22 Serena, 7 Yith, 20 adversarial schemas), with global tools.64 = serena_replace_in_files, returned HTTP 200 and OK..
  • git diff --check

References:

  • Google function-calling schema contract
  • Google retry strategy

Summary by CodeRabbit

  • New Features

    • Improved compatibility with Google and Gemini request formats.
    • Automatically retries certain invalid requests after safely repairing unsupported tool schemas or thinking settings.
    • Preserves tool names across requests and responses, including names requiring compatibility formatting.
    • Normalizes reasoning effort values to supported provider settings.
  • Bug Fixes

    • Improved handling of unsupported and complex tool parameter schemas.
    • Prevented invalid schema fields from being sent to Google services.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@HaydernCenterpoint
fix(google): eliminate Antigravity request-shape 400s
f1fdb82
@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 49768f9a-c900-47cf-a9d9-450715c8c64c

📥 Commits

Reviewing files that changed from the base of the PR and between 54e0bbf and f1fdb82.

📒 Files selected for processing (9)
  • src/adapters/google-http.ts
  • src/adapters/google-tool-schema.ts
  • src/adapters/google-wire-compiler.ts
  • src/adapters/google.ts
  • src/providers/antigravity-models.ts
  • tests/google-antigravity-wire.test.ts
  • tests/google-tool-schema.test.ts
  • tests/google-vertex-http.test.ts
  • tests/google-wire-compiler.test.ts

📝 Walkthrough

Walkthrough

Changes

Google wire compatibility

Layer / File(s) Summary
Allowlisted tool schema sanitization
src/adapters/google-tool-schema.ts, tests/google-tool-schema.test.ts
Tool schemas now use bounded local $ref resolution, normalized types, controlled anyOf handling, recursive keyword filtering, and an object-root fallback.
Wire request compilation and tool-name restoration
src/adapters/google-wire-compiler.ts, src/adapters/google.ts, tests/google-wire-compiler.test.ts
Requests are compiled into Google wire format, tool names are encoded for transport and restored in parsed tool-call events, and compiled bodies are used across Google modes.
Invalid-request repair and compatibility replay
src/adapters/google-wire-compiler.ts, src/adapters/google-http.ts, tests/google-vertex-http.test.ts, tests/google-wire-compiler.test.ts
Selected schema and thinking-level 400 responses trigger one repaired request replay while preserving retry accounting.
Antigravity thinking-level normalization
src/providers/antigravity-models.ts, tests/google-antigravity-wire.test.ts
Claude effort values are mapped to supported CCA thinking levels, including clamping max and ultra to high.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GoogleAdapter
  participant WireCompiler
  participant RetryFetcher
  participant GoogleAPI
  GoogleAdapter->>WireCompiler: compile request and tool schemas
  WireCompiler-->>GoogleAdapter: wire body and name restoration
  GoogleAdapter->>RetryFetcher: send compiled request
  RetryFetcher->>GoogleAPI: request
  GoogleAPI-->>RetryFetcher: 400 INVALID_ARGUMENT
  RetryFetcher->>WireCompiler: repair request body
  WireCompiler-->>RetryFetcher: repaired body
  RetryFetcher->>GoogleAPI: one compatibility replay
  GoogleAPI-->>GoogleAdapter: response with wire tool name
  GoogleAdapter->>GoogleAdapter: restore original tool name
Loading

Suggested reviewers: ingwannu, lidge-jun

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main change: Google/Antigravity request-shape handling to avoid 400 responses.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@HaydernCenterpoint
HaydernCenterpoint marked this pull request as ready for review July 23, 2026 03:53
@HaydernCenterpoint
HaydernCenterpoint requested review from Ingwannu and lidge-jun as code owners July 23, 2026 03:53
Copilot AI review requested due to automatic review settings July 23, 2026 03:53
Copilot AI reviewed Jul 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Ingwannu
Ingwannu approved these changes Jul 23, 2026
View reviewed changes

@Ingwannu Ingwannu left a comment

Copy link
Copy Markdown
Owner

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed against current dev. The wire compiler is a bounded allowlist rather than a permissive pass-through; tool-name encoding is deterministic and reversible per request, schema refs are local and depth-limited, and the compatibility replay is limited to one changed request after a matching 400. The adapter is instantiated per request, so the restore-name closure is not shared across concurrent turns. Focused Google tests passed in the combined stack, and the full pre-push suite passed 3,667 / 0 with typecheck and privacy scan. Approved.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Ingwannu
Ingwannu merged commit 5662c7e into lidge-jun:dev Jul 23, 2026
12 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai coderabbitai Bot mentioned this pull request Jul 23, 2026
feat(google): enable Gemini inline image output #355
Merged
3 tasks done
This was referenced Aug 3, 2026
fix(google): map tool_choice onto functionCallingConfig #968
Closed
fix(google): send thinkingLevel for any model with an effort ladder #978
Closed
stack 6/7: triage the overnight PRs and fix the #955 defects they found #973
Merged
This was referenced Aug 15, 2026
fix(google): replay Gemini thought signatures through the web-search loop #1772
Closed
fix(google): retry transient 429/5xx for AI Studio direct requests #1851
Merged
fix(google): allow AI Studio bare Gemini Flash IDs #1739
Merged
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
@lidge-jun
devlog: WP4 lidge-jun#309 Sol audit FAIL (codec collision nondetermin…
407782b
…ism + Vertex allowlist overreach) — NEEDS_HUMAN, not merged
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
@Ingwannu
Merge pull request lidge-jun#309 from HaydernCenterpoint/agent/google…
f475520
…-wire-compatibility

fix(google): comprehensively eliminate Antigravity request-shape 400s
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
@lidge-jun
merge: integrate maintainer dev c63091b into review stack — upstream l…
65cfa3c
…idge-jun#307/lidge-jun#309/lidge-jun#279/lidge-jun#303/lidge-jun#318/lidge-jun#319 + v2.7.34 joined with local lidge-jun#304 merge and lidge-jun#279 fixups (models-auth revert, abortable SSE decoder)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@Ingwannu Ingwannu Ingwannu approved these changes
@lidge-jun lidge-jun Awaiting requested review from lidge-jun lidge-jun is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@HaydernCenterpoint @Ingwannu
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.