From bf6144c9e1f57cb0348c0fe2ddfa0ab781a9e966 Mon Sep 17 00:00:00 2001 From: Marco Beretta <81851188+berry-13@users.noreply.github.com> Date: Tue, 25 Aug 2026 14:58:02 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=9B=EF=B8=8F=20fix:=20Withhold=20the?= =?UTF-8?q?=20Seeded=20Model=20Catalogue=20Until=20Models=20Resolve=20(#15?= =?UTF-8?q?035)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `useGetModelsQuery` seeds from a static fallback config, so `modelsQuery.data` describes a hardcoded model list both before the mounted fetch resolves and after it fails outright. The agent builder read that seed as authoritative and offered models the active server configuration never exposed. Blank the catalogue until the mounted fetch actually succeeds, surface the failure in the model panel instead of silently falling back to the seed, and refuse to create an agent against a provider/model pair the resolved catalogue does not offer. Also wires the builder's orphaned `htmlFor` labels to the controls they name. --- client/src/common/types.ts | 1 + .../Agents/AgentCategorySelector.tsx | 1 + .../SidePanel/Agents/AgentConfig.tsx | 1 + .../SidePanel/Agents/AgentPanel.test.tsx | 137 +++++++++++++++++- .../SidePanel/Agents/AgentPanel.tsx | 35 ++++- .../SidePanel/Agents/ModelPanel.test.tsx | 45 ++++++ .../SidePanel/Agents/ModelPanel.tsx | 48 ++++-- 7 files changed, 251 insertions(+), 17 deletions(-) diff --git a/client/src/common/types.ts b/client/src/common/types.ts index cd9c5a7962..d1c53bbfa5 100644 --- a/client/src/common/types.ts +++ b/client/src/common/types.ts @@ -227,6 +227,7 @@ export type AgentModelPanelProps = { agent_id?: string; providers: Option[]; models: Record; + modelsError: boolean; modelsReady: boolean; setActivePanel: React.Dispatch>; }; diff --git a/client/src/components/SidePanel/Agents/AgentCategorySelector.tsx b/client/src/components/SidePanel/Agents/AgentCategorySelector.tsx index 4485c0b08d..7f47061b2e 100644 --- a/client/src/components/SidePanel/Agents/AgentCategorySelector.tsx +++ b/client/src/components/SidePanel/Agents/AgentCategorySelector.tsx @@ -77,6 +77,7 @@ const AgentCategorySelector: React.FC<{ className?: string }> = ({ className }) return ( * {selectedValue} + {selectPlaceholder} {items.map((item) => (