Skip to content

Commit 2a60598

Browse files
committed
fix(catalog): omit bare openai only when non-openai providers exist
1 parent b24a29b commit 2a60598

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

‎src/codex/catalog/sync.ts‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -503,12 +503,15 @@ export async function syncCatalogModels(config: OcxConfig): Promise<{
503503
// native AND routed so the advertised flag matches the implemented endpoint (phase 120.4) and a
504504
// native template can never leak supports_websockets while the flag is off.
505505
const wsEnabled = websocketsEnabled(config);
506-
const openaiProv = config.providers?.openai;
507-
const includeNativeOpenAi = Boolean(
508-
openaiProv
509-
&& openaiProv.disabled !== true
510-
&& isCanonicalOpenAiForwardProvider(openaiProv),
506+
const enabledProviders = Object.entries(config.providers ?? {})
507+
.filter(([, prov]) => prov.disabled !== true);
508+
const hasCanonicalOpenai = enabledProviders.some(([name, prov]) =>
509+
name === "openai" && isCanonicalOpenAiForwardProvider(prov),
511510
);
511+
// #636: when the user only configured non-OpenAI providers (e.g. kimi), do not advertise
512+
// bare gpt-* rows that hard-404 via NoEnabledOpenAiProviderError. Keep natives when no
513+
// providers are configured yet (fresh install / catalog bootstrap tests).
514+
const includeNativeOpenAi = enabledProviders.length === 0 || hasCanonicalOpenai;
512515
catalog.models = mergeCatalogEntriesForSync(catalog.models ?? [], goEntries, baseline, featured, wsEnabled, goIds, template, disabledNativeSlugs(config), gatheredProviderNames, multiAgentMode, exactComboSlugs, hasPhysicalComboProvider, includeNativeOpenAi);
513516
clampCatalogModelsToCodexSupport(catalog.models);
514517

0 commit comments

Comments
 (0)