From e56d69f528f52268c3f7adcddb45c282f076e2b1 Mon Sep 17 00:00:00 2001 From: Unsloth Date: Fri, 29 May 2026 03:17:39 -0700 Subject: [PATCH] studio: reflect pre-selected Search/Code tools when no model is loaded The Search and Code pills only lit up when the tool was usable right now (a model loaded and capable), so a tool turned on from the + menu showed as off in the pill while the menu showed it on. toolsEnabled is persisted and takes effect once a capable model loads, so the pill should reflect it. The pills now disable only when a loaded model lacks the capability, and otherwise reflect the selected state. Applied to the main and compare composers. --- .../frontend/src/components/assistant-ui/thread.tsx | 9 ++++++--- .../frontend/src/features/chat/shared-composer.tsx | 12 +++++++----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/studio/frontend/src/components/assistant-ui/thread.tsx b/studio/frontend/src/components/assistant-ui/thread.tsx index 85989b1a41..b87d5b05b0 100644 --- a/studio/frontend/src/components/assistant-ui/thread.tsx +++ b/studio/frontend/src/components/assistant-ui/thread.tsx @@ -1137,7 +1137,9 @@ const WebSearchToggle: FC = () => { ? externalProviders.find((p) => p.id === externalSelection.providerId) : undefined; const isKimiExternal = selectedExternalProvider?.providerType === "kimi"; - const disabled = !modelLoaded || !(supportsTools || supportsBuiltinWebSearch); + // Disable only when a loaded model lacks the capability; with no model the + // tool can still be pre-selected and reflected, matching the + menu. + const disabled = modelLoaded && !(supportsTools || supportsBuiltinWebSearch); return (