Prevent auto-sync from wiping manually-imported models when the upstream
/models endpoint fails, times out, or returns an empty list. Added
`allowEmpty` option (default false) to replaceCustomModels — callers that
intentionally clear all models (DELETE ?all=true) pass `allowEmpty: true`.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The wrapInCloudCodeEnvelopeForClaude function converts Claude message
blocks to Antigravity/Gemini parts format but only handles text,
tool_use, and tool_result types. Image blocks (type: 'image' with
base64 source) are silently dropped, causing Claude models routed
through Antigravity to never receive image content.
This adds handling for image blocks, converting them to inlineData
format (the same format the Gemini path already uses successfully).
Tested: Claude via Antigravity now correctly receives and describes
image content that was previously invisible.
- copilot-usage: use future reset date (2026-12-31) to avoid stale
quota window causing remainingPercentage to reset to 100%
- request-log-migration: close SQLite DB before cleanup to release
Windows file locks; remove stale archive dir before second test
The models gemini-2.5-flash-preview-image-generation and
gemini-3.1-flash-image-preview were surfacing in the model catalog
via getAllImageModels() from imageRegistry.ts, not from the live
upstream API. Removed them from the image provider registry.
- Reduce maxOutputTokens from 131072 to 65535 for gemini-3.1-pro-high
and gemini-3.1-pro-low, fixing 400 "invalid argument" errors from
Open WebUI when no max_tokens is specified (upstream limit is 65535)
- Filter non-viable models (gemini-3.1-flash-image-preview,
gemini-2.5-flash-preview-image-generation, gemini-3-pro-high/low)
from the live upstream API response in /api/providers/[id]/models
Models removed from available list (not usable via chat completions):
- gemini-3-pro-high/low — returns empty responses, quota unusable
- gemini-2.5-flash/flash-lite — quota always exhausted on free tier
- gemini-3.1-flash-image-preview — preview variant, not functional
Models hidden from quota UI (in addition to above):
- gemini-3-flash-agent — internal agent model
- gemini-3.1-flash-lite — not usable for chat
Kept gemini-3.1-flash-image in available models (confirmed working).
Removed dead gemini-3-pro from bare Pro ID normalization.
- Standardize cooldown fallback to 2 min (COOLDOWN_MS.rateLimit) in both
chatCore and auth.ts instead of inconsistent 60s/undefined
- Return 504 Gateway Timeout instead of 200 OK when SSE collection times
out, with finish_reason "length" to signal incomplete response
A 429 from one Antigravity model was marking the entire provider connection
as rate-limited, blocking ALL other models on the same account. This happened
in two places: chatCore's error classification (primary) and
markAccountUnavailable (secondary). Both now use model-only lockModel() for
passthrough providers instead of connection-wide rateLimitedUntil.
Also adds:
- Bare Pro model ID normalization (gemini-3-pro → gemini-3-pro-low)
matching OpenClaw convention
- Internal model exclusion list for quota display, matching CLIProxyAPI
- Update model list to match CLIProxyAPI filtered models (remove stale
gemini-2.5-pro, claude-sonnet-4-5, claude-sonnet-4, gemini-2.0-flash;
sort alphabetically)
- Extend 404 model-only lockout to passthrough providers so one missing
model doesn't lock out the entire Antigravity connection
- Always use streaming upstream endpoint (generateContent causes upstream
400 for some models that internally convert to OpenAI format with
stream_options); collect SSE into JSON for non-streaming clients
- Fix unlimited quota models showing 0% by checking q.unlimited before
recalculating percentage