From 34d70442bf132c6772dc528875377e4d16a221ec Mon Sep 17 00:00:00 2001 From: Tam Nhu Tran Date: Fri, 10 Apr 2026 17:42:24 -0400 Subject: [PATCH] fix(cliproxy): keep new live provider models selectable --- ui/src/lib/model-catalogs.ts | 30 ++++++++++++++--------- ui/tests/unit/ui/lib/preset-utils.test.ts | 8 ++++++ 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/ui/src/lib/model-catalogs.ts b/ui/src/lib/model-catalogs.ts index 2ccccf28..ad809f3c 100644 --- a/ui/src/lib/model-catalogs.ts +++ b/ui/src/lib/model-catalogs.ts @@ -936,39 +936,47 @@ export function getSupplementalCatalogModels( .map((modelId) => normalizeModelId(modelId)) ); const seenCanonicalIds = new Set(); - const normalizedAvailableIds = new Set( - availableModels.map((model) => normalizeModelId(stripManagedModelPrefix(model.id))) - ); + const normalizedRawIds = new Set(availableModels.map((model) => normalizeModelId(model.id))); return availableModels.filter((availableModel) => { + const normalizedAvailableModelId = normalizeModelId(availableModel.id); const strippedModelId = stripManagedModelPrefix(availableModel.id); const baseModelId = stripCustomtoolsSuffix(strippedModelId); const matchedModel = findCatalogModelInCatalog(staticCatalog, strippedModelId) ?? findCatalogModelInCatalog(staticCatalog, baseModelId); - if (!matchedModel) return false; - if (recommendedIds.has(normalizeModelId(strippedModelId))) { return false; } - const canonicalId = normalizeModelId(matchedModel.id); - if (recommendedCanonicalIds.has(canonicalId)) { - return false; - } - if (seenCanonicalIds.has(canonicalId)) { + if ( + normalizedAvailableModelId !== normalizeModelId(strippedModelId) && + normalizedRawIds.has(normalizeModelId(strippedModelId)) + ) { return false; } const normalizedBaseModelId = normalizeModelId(baseModelId); if ( normalizedBaseModelId !== normalizeModelId(strippedModelId) && - normalizedAvailableIds.has(normalizedBaseModelId) + normalizedRawIds.has(normalizedBaseModelId) ) { return false; } + const canonicalId = matchedModel ? normalizeModelId(matchedModel.id) : normalizedBaseModelId; + if (matchedModel && recommendedCanonicalIds.has(canonicalId)) { + return false; + } + if (seenCanonicalIds.has(canonicalId)) { + return false; + } + + if (!matchedModel && normalizedProvider === 'agy') { + return false; + } + seenCanonicalIds.add(canonicalId); return true; }); diff --git a/ui/tests/unit/ui/lib/preset-utils.test.ts b/ui/tests/unit/ui/lib/preset-utils.test.ts index a258523b..2049860a 100644 --- a/ui/tests/unit/ui/lib/preset-utils.test.ts +++ b/ui/tests/unit/ui/lib/preset-utils.test.ts @@ -173,6 +173,14 @@ describe('claude preset utils', () => { ); }); + it('preserves newly advertised non-Antigravity models in the supplemental list', () => { + const supplementalCodexModels = getSupplementalCatalogModels('codex', MODEL_CATALOGS.codex, [ + { id: 'gpt-5.9-codex', owned_by: 'openai' }, + ]); + + expect(supplementalCodexModels).toEqual([{ id: 'gpt-5.9-codex', owned_by: 'openai' }]); + }); + it('does not silently swap Gemini Flash presets to flash-lite', () => { const availableModels = [{ id: 'gemini-3.1-flash-lite-preview', owned_by: 'google' }];