Use a free-text model id for providers without an enumerable model list

This commit is contained in:
ZacharyZhang-NY committed 2026-05-30 01:27:38 -04:00
1 parent d4ace283d1
commit 2dbab2c1fe
5 files changed
+29 -5

No files matched your search

+4
View File
@@ -292,6 +292,10 @@ export interface ProviderCatalogEntry {
signInUrl: string | null;
credentialHelp: string;
models: ProviderCatalogModel[];
/** True when the provider exposes a real models endpoint we can fetch from.
* When false (e.g. the Codex subscription, which has no enumerable list), the
* UI offers a free-text model id instead of a fixed dropdown. */
supportsLiveModels: boolean;
/** Set for user-configured OpenAI/Anthropic-compatible endpoints: the UI
* collects a base URL + API key + model instead of a fixed provider form. */
customEndpoint?: "openai" | "anthropic";
@@ -1,7 +1,7 @@
import { PROVIDER_AUTH_TYPE, type ProviderCatalogEntry } from "./domain";
import { listProviderModels } from "./provider-models";
const RAW_CATALOG: Omit<ProviderCatalogEntry, "models">[] = [
const RAW_CATALOG: Omit<ProviderCatalogEntry, "models" | "supportsLiveModels">[] = [
{
key: "openai",
label: "OpenAI",
@@ -150,7 +150,19 @@ const RAW_CATALOG: Omit<ProviderCatalogEntry, "models">[] = [
},
];
// Providers with no enumerable models endpoint: the Codex subscription and the
// browser-token / cloud connectors. Their model id is entered as free text.
const CURATED_MODEL_PROVIDERS = new Set([
"github-copilot",
"google-antigravity",
"gpt-account",
"azure-openai",
"aws-bedrock",
"vertex-ai",
]);
export const PROVIDER_CATALOG: ProviderCatalogEntry[] = RAW_CATALOG.map((entry) => ({
...entry,
models: listProviderModels(entry.key),
supportsLiveModels: !CURATED_MODEL_PROVIDERS.has(entry.key),
}));