fix(providers): scope Antigravity mitmAlias tier ids to the safe static alias (#11824) - #11988
Merged
diegosouzapw merged 1 commit intoAug 29, 2026
Conversation
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…ic alias (diegosouzapw#11824) (diegosouzapw#11988) Co-authored-by: Markus Hartung <mail@hartmark.se>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #11824
Refs #11651
Root cause
importManagedModels()rebuilds the AntigravitymitmAliastable fromgetSyncedAvailableModels("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:fetchAvailableModelslists 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-tieredendpoint 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 staticANTIGRAVITY_MODEL_ALIASEStable already knows only has a safe-tieredtarget (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-tieredmapping, 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)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 passnode scripts/check/check-file-size.mjs— OKnode 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— OKnpm run typecheck:core— clean (exit 0)npx eslint --suppressions-location config/quality/eslint-suppressions.json <changed files>— exit 0