From cd1e43ab0e82ed13b88453eb7d8b84e8fa34879d Mon Sep 17 00:00:00 2001 From: Dotta Date: Fri, 2 Oct 2026 22:21:52 -0500 Subject: [PATCH] Match model and thinking effort selects in agent setup Co-Authored-By: Paperclip --- ui/src/components/AgentConfigForm.tsx | 47 ++++++++++++++++++- ui/src/components/new-agent/NewAgentSetup.tsx | 10 ++-- ui/src/components/ui/select.tsx | 6 +++ ...provider-routing-06-production.stories.tsx | 29 ++++++++---- 4 files changed, 78 insertions(+), 14 deletions(-) diff --git a/ui/src/components/AgentConfigForm.tsx b/ui/src/components/AgentConfigForm.tsx index 4e2d116e3e1..a3deefdc87e 100644 --- a/ui/src/components/AgentConfigForm.tsx +++ b/ui/src/components/AgentConfigForm.tsx @@ -44,7 +44,8 @@ import { PopoverTrigger, } from "@/components/ui/popover"; import { Button } from "@/components/ui/button"; -import { selectTriggerClassName } from "@/components/ui/select"; +import { Input } from "@/components/ui/input"; +import { NativeSelect, selectTriggerClassName } from "@/components/ui/select"; import { AdapterMark } from "./AdapterMark"; import { FolderOpen, Heart, ChevronDown, X, Copy, Check, ExternalLink, Loader2, TriangleAlert, Bug } from "lucide-react"; import { asBoolean, asFiniteNumber, asObject, cn } from "../lib/utils"; @@ -3755,6 +3756,7 @@ export function ModelDropdown({ detectModelLabel, emptyDetectHint, defaultLabel, + presentation = "searchable", }: { models: AdapterModel[]; value: string; @@ -3776,8 +3778,10 @@ export function ModelDropdown({ detectModelLabel?: string; emptyDetectHint?: string; defaultLabel?: string; + presentation?: "searchable" | "native"; }) { const [modelSearch, setModelSearch] = useState(""); + const [enteringCustomModel, setEnteringCustomModel] = useState(false); const [detectingModel, setDetectingModel] = useState(false); const selected = models.find((m) => m.id === value); const manualModel = modelSearch.trim(); @@ -3846,6 +3850,47 @@ export function ModelDropdown({ } } + if (presentation === "native") { + const customOption = "__paperclip_custom_model__"; + const extraModels = [...new Set([value, ...promotedModelIds])].filter(id => id && (!models.some(model => model.id === id) || promotedModelIds.has(id))); + return ( + + { + const next = event.target.value; + setEnteringCustomModel(next === customOption); + if (next !== customOption) onChange(next); + }} + > + + {extraModels.map(id => )} + {groupedModels.map(({ provider, entries }) => groupByProvider ? ( + + {entries.map(model => )} + + ) : entries.map(model => ))} + {creatable && } + + {enteringCustomModel && ( + + )} + {loadingModels &&

Loading models…

} + {onRefreshModels && } +
+ ); + } + return ( result.status === "fail" || result.checks.some((check) => check.code === ADAPTER_AUTH_MISSING_CHECK_CODE); @@ -844,6 +844,7 @@ function Setup({
{showModel && !usingKimiApi && ( 0 && ( - + )}
diff --git a/ui/src/components/ui/select.tsx b/ui/src/components/ui/select.tsx index 7f8e4ab4549..9c35a9b2409 100644 --- a/ui/src/components/ui/select.tsx +++ b/ui/src/components/ui/select.tsx @@ -4,6 +4,12 @@ import { Select as SelectPrimitive } from "radix-ui" import { cn } from "@/lib/utils" +export const nativeSelectClassName = "w-full rounded-md border border-border bg-background px-2.5 py-1.5 text-sm leading-5 outline-none focus-visible:ring-2 focus-visible:ring-ring" + +export function NativeSelect({ className, ...props }: React.ComponentProps<"select">) { + return