Skip to content

Fix antigravity provider integration — 404, stream processor, schema sanitization, model filtering#10

Open
alexsvdk wants to merge 1 commit into
nhatbien:mainfrom
alexsvdk:main
Open

Fix antigravity provider integration — 404, stream processor, schema sanitization, model filtering#10
alexsvdk wants to merge 1 commit into
nhatbien:mainfrom
alexsvdk:main

Conversation

@alexsvdk
Copy link
Copy Markdown

@alexsvdk alexsvdk commented Apr 9, 2026

Summary

Complete fix for the Antigravity (Google Cloud Code) provider. All issues discovered during live testing have been resolved.

Changes

Network / Routing

  • Fix DEFAULT_BASE_URLS: Added daily-cloudcode-pa.googleapis.com as the primary endpoint — the old list only had sandbox and legacy URLs, causing 404 on all requests
  • Update DEFAULT_USER_AGENT to antigravity/1.22.2

Stream Processing

  • Fix sdkMode: Changed from 'openai' to 'anthropic' so requests route to AntigravityStreamProcessor instead of OpenAIStreamProcessor (which couldn't parse the Gemini-format SSE stream — no output was produced)
  • Add StreamingStartedError: Prevents endpoint-fallback retry after streaming has already started, which would replay tool calls and produce duplicates in the Copilot UI
  • Fix thinkingTagBuffer flush: The tag lookahead buffer could hold up to 10 chars past end of stream; now flushed in the finally block before final text flush
  • Add totalTextEmitted counter + thought-only fallback: If the stream ends with zero text emitted but accumulated thinking content (e.g. GPT OSS 120B which returns 100% thought:true parts), the thinking content is emitted as a text response instead of showing "Sorry, no response was returned"

JSON Schema Sanitization

  • Expand GEMINI_UNSUPPORTED_FIELDS in both handler.ts and requestHelpers.ts: added const, enumDescriptions, enumCaseInsensitive, enumNormalizeWhitespace, default, deprecated, readOnly, writeOnly, format, cache_control, propertyNames — all sourced from anti-api's json-schema-cleaner; these cause HTTP 400 from the Gemini API

Model Filtering

  • fetchModels / getCachedModels: Models are now filtered to only those returned by the quota API endpoint — unavailable models are hidden. Falls back to full list if the API returns an empty response
  • tryFetchQuotaFromEndpoint: Tracks all models present in the response (not just those with explicit quotaInfo) — presence alone indicates availability
  • Fix setApiKey ordering for both new-account and credential-refresh paths: API key (with filtered model list) is now persisted before the account-change event fires, so provideLanguageModelChatInformation already sees the correct model list
  • Remove addAllAntigravityModelsToCompatible call on login — models are no longer auto-added to the Compatible Provider

Config & Aliases

  • Update model aliases: Gemini 3.1 naming (gemini-3.1-pro-*), claude-opus-4-6-thinking, gpt-oss-120bgpt-oss-120b-medium, dot-notation Claude variants
  • Add claude-opus-4-6-thinking to antigravity.json
  • Translate tooltip fields in antigravity.json to English
  • Update baseUrl in antigravity.json to daily-cloudcode-pa.googleapis.com/v1internal

Version

  • Bumped 0.15.270.16.0

…chema sanitization, model filtering

- Fix DEFAULT_BASE_URLS: add daily-cloudcode-pa.googleapis.com as primary endpoint
- Fix sdkMode 'openai' → 'anthropic' to route through AntigravityStreamProcessor
- Add StreamingStartedError to prevent endpoint-retry after streaming starts (avoids tool call duplication)
- Expand GEMINI_UNSUPPORTED_FIELDS: add const, enumDescriptions, default, format, cache_control and 6 more
- Fix fetchModels/getCachedModels: filter models by API quota response; fall back to all on empty
- Fix setApiKey ordering: persist filtered model list before account-change event fires (both new and existing account paths)
- Fix thinkingTagBuffer: flush remainder at stream end to avoid losing trailing response
- Add totalTextEmitted counter: if stream ends with zero text but non-empty thinking, emit thinking as text (fixes GPT OSS 120B thought-only responses)
- Remove auto-add-to-compatible on login
- Update DEFAULT_USER_AGENT to antigravity/1.22.2
- Update model aliases: Gemini 3.1 naming, claude-opus-4-6-thinking, gpt-oss-120b-medium
- Add claude-opus-4-6-thinking to antigravity.json; translate tooltip fields to English
- Bump version 0.15.27 → 0.16.0
@alexsvdk alexsvdk marked this pull request as ready for review April 9, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant