Skip to content

fix(providers): scope Antigravity mitmAlias tier ids to the safe static alias (#11824) - #11988

Merged
diegosouzapw merged 1 commit into
release/v3.8.51from
fix/11824-antigravity-mitm-alias-scoping
Aug 29, 2026
Merged

diegosouzapw merged 1 commit into
release/v3.8.51from
fix/11824-antigravity-mitm-alias-scoping

Conversation

@diegosouzapw

Copy link
Copy Markdown
Owner

Closes #11824
Refs #11651

Root cause

importManagedModels() rebuilds the Antigravity mitmAlias table from getSyncedAvailableModels("antigravity"), which is a UNION across every connected account's discovered model catalog (src/lib/db/models.ts:465-487). Its mapping builder short-circuits to an identity mapping (gemini-3.7-flash-high -> antigravity/gemini-3.7-flash-high) whenever that literal id appears anywhere in the union — i.e. if just one connected account's :fetchAvailableModels lists it directly. cleanModelName() (open-sse/executors/antigravity.ts) then consults this global table first, as "authoritative", before ever falling back to the safe static alias (gemini-3.7-flash-high -> gemini-3.7-flash-tiered). Google's Cloud Code Assist backend only allows the tier-suffixed ids on accounts/projects it has specifically provisioned for them; every other account can only call the shared -tiered endpoint id. So one account's discovery silently reroutes every sibling account's requests for this model into a 404 — the exact symptom in #11824 ("works with one account, 404s on another") and its twin report #11651.

Fix

In the antigravity branch of importManagedModels(), after building the dynamic mapping dictionary, every display id that the static ANTIGRAVITY_MODEL_ALIASES table already knows only has a safe -tiered target (gemini-3.7-flash, -high, -medium, -low) is forced to always resolve through that static alias, regardless of what any single connection's own discovery reported. This keeps the mapping table safe across every connected account instead of trusting the cross-connection union.

Regression test

tests/unit/managed-model-import.test.ts — new test #11824: syncing account A's model catalog must not route account B's gemini-3.7-flash-high to an id B's own discovery never advertised (two connections, asymmetric discovery); confirmed RED before the fix (identical to the plan-file's proven repro), GREEN after. Also updated the existing single-connection test's expectation (mitmMappings["gemini-3.7-flash-high"]) from the unsafe identity mapping to the safe -tiered mapping, since routing the literal tier id was never actually safe once other accounts share the same global table.

Gates run (all green)

  • node --import tsx/esm --test tests/unit/managed-model-import.test.ts (10/10 pass)
  • Sibling tests touching the changed symbols/files: antigravity-model-aliases, antigravity-per-model-output-cap, antigravity-retired-public-models, db-models-crud, db-models-split, model-sync-route, agent-bridge-mappings-sync-8656, chat-messages-validation-6402, hard-session-lease-bypass-inventory — all pass
  • node scripts/check/check-file-size.mjs — OK
  • node scripts/check/check-complexity.mjs — OK (2672 ≤ baseline 2774)
  • node scripts/check/check-cognitive-complexity.mjs — OK (1192 ≤ baseline 1223)
  • node scripts/check/check-changelog-integrity.mjs — OK
  • npm run typecheck:core — clean (exit 0)
  • npx eslint --suppressions-location config/quality/eslint-suppressions.json <changed files> — exit 0

⚠️ base-red inherited: #11874 — docs-sync (README provider count), unrelated to this fix.

@diegosouzapw
diegosouzapw merged commit 02ba573 into release/v3.8.51 Aug 29, 2026
20 checks passed
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
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.

[BUG] Gemini FLash 3.7 high work with one account and dont work with another one

2 participants