From a83c2d89fe1da92acaea16fc070fa4fac3ee21bb Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Fri, 12 Jun 2026 00:05:10 -0700 Subject: [PATCH] Fix custom provider models missing from model dropdowns The /models endpoint restricted results to providers configured in Fusion's auth.json/models.json stores, but custom providers live in global settings and register under customProviderRegistryKey(). Their keys were never added to the allowlist, so their models were filtered out before reaching the dropdowns. Add the custom provider registry keys to the configured-providers set. Co-Authored-By: Claude Opus 4.8 (1M context) --- .changeset/fix-custom-provider-models-dropdown.md | 5 +++++ packages/dashboard/src/routes/register-model-routes.ts | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .changeset/fix-custom-provider-models-dropdown.md diff --git a/.changeset/fix-custom-provider-models-dropdown.md b/.changeset/fix-custom-provider-models-dropdown.md new file mode 100644 index 0000000000..cd10678929 --- /dev/null +++ b/.changeset/fix-custom-provider-models-dropdown.md @@ -0,0 +1,5 @@ +--- +"@runfusion/fusion": patch +--- + +Fix custom provider models not appearing in model dropdowns. The `/models` endpoint filtered results to providers configured in Fusion's auth stores, which excluded custom providers (stored in global settings). Their registry keys are now added to the allowlist so their models surface in pickers. diff --git a/packages/dashboard/src/routes/register-model-routes.ts b/packages/dashboard/src/routes/register-model-routes.ts index a1b2e4ec27..e332c1c4e9 100644 --- a/packages/dashboard/src/routes/register-model-routes.ts +++ b/packages/dashboard/src/routes/register-model-routes.ts @@ -1,7 +1,8 @@ import { access, readFile } from "node:fs/promises"; import { homedir } from "node:os"; import { join } from "node:path"; -import { resolvePlanningSettingsModel } from "@fusion/core"; +import { customProviderRegistryKey, resolvePlanningSettingsModel } from "@fusion/core"; +import type { CustomProvider } from "@fusion/core"; import { ApiError } from "../api-error.js"; import type { ApiRouteRegistrar } from "./types.js"; @@ -77,6 +78,7 @@ export const registerModelRoutes: ApiRouteRegistrar = (ctx) => { let useCursorCli = false; let resolvedPlanningProvider: string | undefined; let resolvedPlanningModelId: string | undefined; + let customProviders: CustomProvider[] = []; if (store) { try { const globalStore = store.getGlobalSettingsStore(); @@ -89,6 +91,7 @@ export const registerModelRoutes: ApiRouteRegistrar = (ctx) => { useDroidCli = globalSettings.useDroidCli === true; useLlamaCpp = globalSettings.useLlamaCpp === true; useCursorCli = (globalSettings as Record).useCursorCli === true; + customProviders = globalSettings.customProviders ?? []; const mergedSettings = await store.getSettingsFast(); const resolvedPlanningModel = resolvePlanningSettingsModel(mergedSettings); @@ -163,6 +166,11 @@ export const registerModelRoutes: ApiRouteRegistrar = (ctx) => { if (useClaudeCli) configuredProviders.add("pi-claude-cli"); if (useDroidCli) configuredProviders.add("droid-cli"); if (useLlamaCpp) configuredProviders.add("llama-server"); + // Custom providers are configured in Fusion's global settings rather than + // the auth.json/models.json stores, so add their registry keys explicitly. + for (const provider of customProviders) { + configuredProviders.add(customProviderRegistryKey(provider, customProviders)); + } models = models.filter((m) => configuredProviders.has(m.provider)); res.json({