diff --git a/apps/web/src/components/settings/ProjectDefaultsSettings.tsx b/apps/web/src/components/settings/ProjectDefaultsSettings.tsx index 43c4419962a0..cdd107b150da 100644 --- a/apps/web/src/components/settings/ProjectDefaultsSettings.tsx +++ b/apps/web/src/components/settings/ProjectDefaultsSettings.tsx @@ -79,6 +79,7 @@ export function ProjectDefaultsSettings({ category }: { category: ProjectSetting const mixedModel = useScopedSettingsMixed(["defaultModelSelection"]); const mixedFallback = useScopedSettingsMixed(["fallbackModelSelection"]); const fallbackSelection = settings.fallbackModelSelection ?? selection; + const fallbackEntry = entries.find((entry) => entry.instanceId === fallbackSelection?.instanceId); const fallbackModelOptions = getCustomModelOptionsByInstance( settings, providers, @@ -242,34 +243,56 @@ export function ProjectDefaultsSettings({ category }: { category: ProjectSetting } control={ fallbackSelection ? ( - { - const reason = modelDisabledReason(instanceId, model); - if (reason) { - toastManager.add({ - type: "error", - title: "Fallback model not saved", - description: reason, - }); - return; - } - updateSettings({ fallbackModelSelection: createModelSelection(instanceId, model) }); - }} - /> +
+ { + const reason = modelDisabledReason(instanceId, model); + if (reason) { + toastManager.add({ + type: "error", + title: "Fallback model not saved", + description: reason, + }); + return; + } + updateSettings({ fallbackModelSelection: createModelSelection(instanceId, model) }); + }} + /> + {fallbackEntry && !mixedFallback && settings.fallbackModelSelection !== null ? ( + + updateSettings({ + fallbackModelSelection: createModelSelection( + fallbackSelection.instanceId, + fallbackSelection.model, + options, + ), + }) + } + /> + ) : null} +
) : ( No providers available )