From cfd61f0ac76a6f578f14bcd0c668bb011b0ff330 Mon Sep 17 00:00:00 2001 From: Roland Tannous Date: Thu, 26 Mar 2026 11:52:41 +0000 Subject: [PATCH] fix: fetch local models after auth refresh completes --- .../frontend/src/features/chat/chat-page.tsx | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/studio/frontend/src/features/chat/chat-page.tsx b/studio/frontend/src/features/chat/chat-page.tsx index 953c77a680..6951a8fdd6 100644 --- a/studio/frontend/src/features/chat/chat-page.tsx +++ b/studio/frontend/src/features/chat/chat-page.tsx @@ -595,20 +595,21 @@ export function ChatPage(): ReactElement { useEffect(() => { if (getTrainingCompareHandoff()) return; - void refresh(); - void listLocalModels().then((res) => { - setLocalModels( - res.models - .filter((m) => m.source === "lmstudio" || m.source === "models_dir") - .map((m) => ({ - id: m.id, - name: m.display_name, - baseModel: m.source === "lmstudio" ? "LM Studio" : "Local models", - updatedAt: m.updated_at ?? undefined, - source: "local" as const, - })), - ); - }).catch(() => {}); + void refresh().then(() => { + listLocalModels().then((res) => { + setLocalModels( + res.models + .filter((m) => m.source === "lmstudio" || m.source === "models_dir") + .map((m) => ({ + id: m.id, + name: m.display_name, + baseModel: m.source === "lmstudio" ? "LM Studio" : "Local models", + updatedAt: m.updated_at ?? undefined, + source: "local" as const, + })), + ); + }).catch(() => {}); + }); }, [refresh]); useEffect(() => {