From 18d516ba7e2de48d2974bab207296e9f45257262 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Fri, 4 Sep 2026 13:27:32 -0700 Subject: [PATCH] fix(models): make catalog feature selection explicit --- apps/sim/app/(landing)/models/utils.test.ts | 15 +++++++++++++-- apps/sim/app/(landing)/models/utils.ts | 5 +++++ apps/sim/providers/models.test.ts | 11 +++++++++++ apps/sim/providers/models.ts | 5 +++++ 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/apps/sim/app/(landing)/models/utils.test.ts b/apps/sim/app/(landing)/models/utils.test.ts index 3f51e373b86..235866c97e4 100644 --- a/apps/sim/app/(landing)/models/utils.test.ts +++ b/apps/sim/app/(landing)/models/utils.test.ts @@ -53,8 +53,19 @@ describe('model catalog capability facts', () => { expect(generalModel?.bestFor).toBeUndefined() }) - it.concurrent('features the explicitly recommended OpenAI model first', () => { - expect(getProviderBySlug('openai')?.featuredModels[0]?.id).toBe('gpt-6-astra') + it.concurrent('uses explicit catalog features for flagship provider cards', () => { + expect( + ['anthropic', 'openai', 'google'].map((providerId) => { + const model = getProviderBySlug(providerId)?.featuredModels[0] + return { providerId, modelId: model?.id, featured: model?.featured } + }) + ).toEqual([ + { providerId: 'anthropic', modelId: 'claude-fable-5-1', featured: true }, + { providerId: 'openai', modelId: 'gpt-6-astra', featured: true }, + { providerId: 'google', modelId: 'gemini-3.8-flash', featured: true }, + ]) + + expect(getProviderBySlug('anthropic')?.featuredModels[0]?.recommended).toBe(false) }) it.concurrent('includes input-size tiers in structured pricing bounds', () => { diff --git a/apps/sim/app/(landing)/models/utils.ts b/apps/sim/app/(landing)/models/utils.ts index bdc3981ee47..4d5ecadb7b5 100644 --- a/apps/sim/app/(landing)/models/utils.ts +++ b/apps/sim/app/(landing)/models/utils.ts @@ -120,6 +120,7 @@ export interface CatalogModel { contextWindow: number | null releaseDate: string | null deprecated: boolean + featured: boolean recommended: boolean pricing: PricingInfo capabilities: ModelCapabilities @@ -441,6 +442,9 @@ function computeModelRelevanceScore(model: CatalogModel): number { } function compareModelsByRelevance(a: CatalogModel, b: CatalogModel): number { + const featuredDifference = Number(b.featured) - Number(a.featured) + if (featuredDifference !== 0) return featuredDifference + const recommendationDifference = Number(b.recommended) - Number(a.recommended) if (recommendationDifference !== 0) return recommendationDifference @@ -477,6 +481,7 @@ const rawProviders = Object.values(PROVIDER_DEFINITIONS).map((provider) => { contextWindow: model.contextWindow ?? null, releaseDate: model.releaseDate ?? null, deprecated: !!model.sunset, + featured: model.featured ?? false, recommended: model.recommended ?? false, pricing: model.pricing, capabilities: mergedCapabilities, diff --git a/apps/sim/providers/models.test.ts b/apps/sim/providers/models.test.ts index dcfd255bdd1..dbf32ffdae7 100644 --- a/apps/sim/providers/models.test.ts +++ b/apps/sim/providers/models.test.ts @@ -50,6 +50,17 @@ describe('OpenAI provider definition', () => { }) }) +describe('catalog featured model metadata', () => { + it('defines at most one active featured model per provider', () => { + for (const provider of Object.values(PROVIDER_DEFINITIONS)) { + const featuredModels = provider.models.filter((model) => model.featured) + + expect(featuredModels.length).toBeLessThanOrEqual(1) + expect(featuredModels.every((model) => model.sunset === undefined)).toBe(true) + } + }) +}) + describe('Anthropic thinking stream visibility', () => { it('classifies visible Claude thinking as summarized rather than raw', () => { for (const providerId of ['anthropic', 'azure-anthropic'] as const) { diff --git a/apps/sim/providers/models.ts b/apps/sim/providers/models.ts index 04809b9708b..84e22f4a81c 100644 --- a/apps/sim/providers/models.ts +++ b/apps/sim/providers/models.ts @@ -93,6 +93,8 @@ interface ModelDefinition { contextWindow?: number /** ISO date string (YYYY-MM-DD) when the model was first publicly released */ releaseDate?: string + /** Promotes this model on public catalog surfaces, independently of workflow recommendations. */ + featured?: boolean recommended?: boolean speedOptimized?: boolean /** @@ -350,6 +352,7 @@ export const PROVIDER_DEFINITIONS: Record = { }, contextWindow: 1050000, releaseDate: '2026-09-03', + featured: true, recommended: true, }, // GPT-4.1 family @@ -922,6 +925,7 @@ export const PROVIDER_DEFINITIONS: Record = { }, contextWindow: 1000000, releaseDate: '2026-09-01', + featured: true, }, { id: 'claude-fable-5', @@ -1697,6 +1701,7 @@ export const PROVIDER_DEFINITIONS: Record = { }, contextWindow: 1048576, releaseDate: '2026-09-02', + featured: true, recommended: true, }, {