diff --git a/ui/src/components/profiles/profile-create-dialog.tsx b/ui/src/components/profiles/profile-create-dialog.tsx index ecd6db70..5f17a911 100644 --- a/ui/src/components/profiles/profile-create-dialog.tsx +++ b/ui/src/components/profiles/profile-create-dialog.tsx @@ -27,7 +27,11 @@ import { useOpenRouterCatalog } from '@/hooks/use-openrouter-models'; import { Loader2, Plus, AlertTriangle, Info, Eye, EyeOff, Settings2, Sparkles } from 'lucide-react'; import { toast } from 'sonner'; import { cn } from '@/lib/utils'; -import { PROVIDER_PRESETS, type ProviderPreset } from '@/lib/provider-presets'; +import { + PROVIDER_PRESETS, + getPresetsByCategory, + type ProviderPreset, +} from '@/lib/provider-presets'; import { searchModels, formatPricingPair, @@ -153,15 +157,21 @@ export function ProfileCreateDialog({ open, onOpenChange, onSuccess }: ProfileCr } }; - // Handle model selection from picker + // Handle model selection from picker - applies to all 4 model tiers const handleModelSelect = (model: CategorizedModel) => { setValue('model', model.id); + setValue('opusModel', model.id); + setValue('sonnetModel', model.id); + setValue('haikuModel', model.id); setModelSearch(model.name); }; - // Check for common URL mistakes + // Check for common URL mistakes - only for truly custom URLs + // Presets (OpenRouter, GLM, GLMT, Kimi) have vetted URLs that may require full paths useEffect(() => { - if (baseUrlValue && selectedPreset === 'custom') { + // Only warn for custom URLs, not preset-selected ones + const isCustomUrl = selectedPreset === 'custom'; + if (baseUrlValue && isCustomUrl) { const lowerUrl = baseUrlValue.toLowerCase(); for (const path of PROBLEMATIC_PATHS) { if (lowerUrl.endsWith(path)) { @@ -177,10 +187,9 @@ export function ProfileCreateDialog({ open, onOpenChange, onSuccess }: ProfileCr }, [baseUrlValue, selectedPreset]); const onSubmit = async (data: FormData) => { - const preset = currentPreset; + // Use user-provided baseUrl (allows customization of preset URLs) const finalData = { ...data, - baseUrl: preset ? preset.baseUrl : data.baseUrl, }; try { await createMutation.mutateAsync(finalData); @@ -212,33 +221,57 @@ export function ProfileCreateDialog({ open, onOpenChange, onSuccess }: ProfileCr