#17398

fix(providers): agy models blocked by antigravity hiddenModelGate & missing Clear All Models reset

Openailuvu-artopened 1d ago

OmniRoute Version

3.8.53 (e9cb075cf6)

Installation Method

Built from source

Operating System

Linux

Node.js Version

v26.8.1

Provider(s) Involved

AGY CLI (agy), Antigravity (antigravity)

Model(s) Involved

claude-opus-5-5-high, claude-opus-5-5-medium, claude-opus-5-5-low, claude-sonnet-5-5-high, claude-sonnet-5-5-medium, claude-sonnet-5-5-low, gemini-4-argon-high, gemini-4-argon-medium, gemini-4-argon-low, claude-opus-4-6-thinking

Client Tool

AGY CLI / Dashboard Model Tester / OpenAI-compatible clients

Description

There are three interacting bugs affecting the agy (AGY CLI) provider model catalog, cache reset, and visibility gate:

  1. Cross-provider hiddenModelGate leak (agy → antigravity) causes false 404 Model not found:

    • createHiddenModelLookup (src/lib/hiddenModelLookup.ts:27-30) keeps agy and antigravity visibility overrides separate in modelCompatOverrides because both "agy" and "antigravity" exist in PROVIDER_ID_TO_ALIAS.
    • However, when a request arrives for agy/<model> (e.g. agy/claude-opus-5-5-high or agy/gemini-4-argon-high), resolveModelOrError (src/sse/handlers/chatHelpers.ts) resolves provider via ALIAS_TO_PROVIDER_ID["agy"] = "antigravity", rewriting the target to antigravity/<model>.
    • handleSingleModelChat (src/sse/handlers/chat.ts:1686-1696) then calls resolvedModelGate(["antigravity/<model>"]) (withHiddenModelGate in src/sse/handlers/chat/hiddenModelGate.ts:15-25), which checks isHidden("antigravity", model) instead of isHidden("agy", model).
    • Consequently, if a model was ever hidden under modelCompatOverrides["antigravity"], every request to agy/<model> is rejected locally in ~10ms with 404 Model not found, even when the model is visible on agy and supported live by Google's /v1internal:streamGenerateContent.
    • Worse, running Test All on agy with Auto-hide failed enabled hits that local 404 and auto-hides all those models under modelCompatOverrides["agy"] as well.
  2. "Clear All Models" button is missing on OAuth providers (agy / antigravity) and does not reset modelCompatOverrides:

    • In src/app/(dashboard)/dashboard/providers/[id]/components/ProviderModelsSection.tsx:241, clearAllButton only checks modelMeta.customModels.length > 0 || providerAliasEntries.length > 0 (ignoring syncedAvailableModels.length > 0) and is omitted from the standard OAuth provider ActionBar at lines 403–419.
    • In src/app/(dashboard)/dashboard/providers/[id]/hooks/useModelVisibilityHandlers.ts:268, handleClearAllModels only calls DELETE /api/provider-models?provider=${providerStorageAlias}&all=true (missing canonical providerId when providerStorageAlias !== providerId, such as ag vs antigravity).
    • In src/app/api/provider-models/route.ts:535-546, DELETE ?all=true clears customModels, syncedAvailableModels, and managed aliases, but does not clear modelCompatOverrides (so hidden flags survive a full model reset).
  3. Stale claude-opus-4-6-thinking in static catalog when liveCatalogAuthoritative is active:

    • open-sse/config/antigravitySharedModels.ts still lists claude-opus-4-6-thinking as a default model, while Google's live /v1internal:fetchAvailableModels for cli/1.3.4 returns claude-opus-5-5-{high,medium,low}, claude-sonnet-5-5-{high,medium,low}, and gemini-4-argon-{high,medium,low}.
    • Because liveCatalogAuthoritative: true is enabled when syncedAvailableModels is fresh (src/lib/providers/modelCatalog.ts:276-288), callers or combos still referencing agy/claude-opus-4-6-thinking fail with: Model 'claude-opus-4-6-thinking' is not available in the active live catalog for provider 'antigravity'.

Steps to Reproduce

  1. Have an active agy connection with synced live models (claude-opus-5-5-high, gemini-4-argon-high, etc.).
  2. Have claude-opus-5-5-high or gemini-4-argon-high marked hidden in modelCompatOverrides["antigravity"] (e.g., from an earlier auto-hide test on the Antigravity provider).
  3. Go to the agy provider page, ensure claude-opus-5-5-high and gemini-4-argon-high are visible (unhidden) on agy, and click Test (or send a chat completion request to agy/claude-opus-5-5-high).
  4. Observe that OmniRoute immediately returns 404 Model not found in ~10ms without contacting upstream.

Expected Behavior

  • Visibility checks in withHiddenModelGate for agy/<model> should respect agy's own visibility state (modelCompatOverrides["agy"]) rather than being blocked by modelCompatOverrides["antigravity"].
  • The Clear All Models button should be available on OAuth providers (agy, antigravity, etc.) when syncedAvailableModels exist, and resetting models should also clear or allow resetting modelCompatOverrides for both providerStorageAlias and providerId.
  • Legacy claude-opus-4-6-thinking / claude-sonnet-4-6 requests should either alias cleanly or remain routable when the live catalog transitions to claude-opus-5-5-* / claude-sonnet-5-5-*.

Actual Behavior

  • Requests to agy/claude-opus-5-5-*, agy/claude-sonnet-5-5-*, and agy/gemini-4-argon-* fail locally with 404 Model not found whenever modelCompatOverrides["antigravity"] has those model IDs hidden.
  • Clearing modelCompatOverrides on both agy and antigravity via PATCH /api/provider-models immediately restores 200 OK responses from Google's upstream for all 17 models.

Test Impact

Needs a new unit test

Error Logs / Output

{"level":30,"time":"2026-10-21T00:08:57.395Z","service":"omniroute","module":"sse","tag":"HTTP","method":"POST","path":"/v1/chat/completions | agy/gemini-4-argon-high | 1 msgs | effort=none","msg":"📥 POST /v1/chat/completions | agy/gemini-4-argon-high | 1 msgs | effort=none"}
{"level":30,"time":"2026-10-21T00:08:57.400Z","service":"omniroute","module":"sse","tag":"ROUTING","msg":"agy/gemini-4-argon-high → antigravity/gemini-4-argon-high"}
{"level":30,"time":"2026-10-21T00:08:57.402Z","service":"omniroute","module":"sse","tag":"MODEL_TEST_ALL","providerId":"agy","modelId":"agy/gemini-4-argon-high","latencyMs":9,"msg":"Tested agy/gemini-4-argon-high: error"}

Validation Plan

  • npx vitest run src/app/\(dashboard\)/dashboard/providers/\[id\]/__tests__/providerModelsSectionVisibilityKey.test.tsx src/app/\(dashboard\)/dashboard/providers/\[id\]/__tests__/useModelVisibilityHandlers.test.tsx
  • Unit test verifying withHiddenModelGate / resolvedModelPolicy checks visibility against the requested provider surface (agy) when agy aliases to antigravity executor.

Activity

1
nolann-dev1d ago