From 3dc212e218e69e1055ed7eb8af3d71ce3c42e9c0 Mon Sep 17 00:00:00 2001 From: Wasim Yousef Said Date: Tue, 24 Mar 2026 11:26:56 +0100 Subject: [PATCH] fix: always show chat tool icons (#4525) * fix: always show chat tool icons, gray out when model doesn't support them Tool icons (Think, Search, Code) were hidden unless a model was loaded and supported those features. Now they're always visible so users can see and pre-select them. If a loaded model doesn't support a feature, the button gets grayed out and disabled instead of being removed. * refactor: centralize Qwen thinking params in store * fix: disable tool buttons when no model is loaded Change disabled condition from `modelLoaded && !supportsX` to `!modelLoaded || !supportsX` so buttons are grayed out both when no model is loaded and when the loaded model lacks the capability. * Fix Qwen3 param clobbering and restore SuggestionItem capability guards - Revert setReasoningEnabled() in the store to a pure boolean setter. Moving the Qwen3 param logic into it caused reconnect/load/refresh paths (which also call setReasoningEnabled) to silently overwrite user-customized or server-provided temperature/topP/topK/minP. - Restore applyQwenThinkingParams() as a standalone function called only from explicit user toggle click handlers in thread.tsx and shared-composer.tsx, matching the pre-PR behavior. - Re-add supportsReasoning/supportsTools guards in the SuggestionItem click handler so that clicking a suggestion card only activates tool toggles the loaded model actually supports. --------- Co-authored-by: Daniel Han --- .../src/components/assistant-ui/thread.tsx | 58 ++++---- .../src/features/chat/shared-composer.tsx | 124 ++++++++++-------- 2 files changed, 98 insertions(+), 84 deletions(-) diff --git a/studio/frontend/src/components/assistant-ui/thread.tsx b/studio/frontend/src/components/assistant-ui/thread.tsx index 8f85ecabbd..91cba5b02b 100644 --- a/studio/frontend/src/components/assistant-ui/thread.tsx +++ b/studio/frontend/src/components/assistant-ui/thread.tsx @@ -132,13 +132,7 @@ const SuggestionItem: FC = () => { const prompt = useAuiState(({ suggestion }) => suggestion.prompt); const isDisabled = useAuiState(({ thread }) => thread.isDisabled); const isRunning = useAuiState(({ thread }) => thread.isRunning); - const supportsTools = useChatRuntimeStore((s) => s.supportsTools); - const supportsReasoning = useChatRuntimeStore((s) => s.supportsReasoning); - const allTools = SUGGESTION_TOOLS[prompt] ?? []; - const tools = allTools.filter((tool) => { - if (tool === "thinking") return supportsReasoning; - return supportsTools; - }); + const tools = SUGGESTION_TOOLS[prompt] ?? []; return ( - )} - {supportsTools && ( - + - )} - {supportsTools && ( - + - )} + )} + aria-label={codeToolsEnabled ? "Disable code execution" : "Enable code execution"} + > + + Code +
{dictationSupported && (