diff --git a/studio/frontend/src/components/assistant-ui/thread.tsx b/studio/frontend/src/components/assistant-ui/thread.tsx index c33ec403f4..85989b1a41 100644 --- a/studio/frontend/src/components/assistant-ui/thread.tsx +++ b/studio/frontend/src/components/assistant-ui/thread.tsx @@ -1315,7 +1315,12 @@ const ComposerToolsMenu: FC<{ side?: "top" | "bottom" }> = ({ const store = useChatRuntimeStore.getState(); store.setActiveThreadId(null); store.setContextUsage(null); - navigate({ to: "/chat", search: { compare: crypto.randomUUID() } }); + // crypto.randomUUID is undefined in non-secure contexts (HTTP over a LAN IP). + const compareId = + typeof globalThis.crypto?.randomUUID === "function" + ? globalThis.crypto.randomUUID() + : `${Date.now()}-${Math.random().toString(36).slice(2, 10)}`; + navigate({ to: "/chat", search: { compare: compareId } }); }, [navigate]); return ( diff --git a/studio/frontend/src/features/chat/shared-composer.tsx b/studio/frontend/src/features/chat/shared-composer.tsx index e7dbe94d95..01a6a27b2d 100644 --- a/studio/frontend/src/features/chat/shared-composer.tsx +++ b/studio/frontend/src/features/chat/shared-composer.tsx @@ -1038,6 +1038,8 @@ export function SharedComposer({ onSelect={() => { setReasoningEnabled(false); applyQwenThinkingParams(false); + // Preserve thinking needs thinking on, so turn it off too. + setPreserveThinking(false); }} > { e.preventDefault(); - setPreserveThinking(!preserveThinking); + const next = !preserveThinking; + setPreserveThinking(next); + // Preserve thinking requires thinking on. + if (next) { + setReasoningEnabled(true); + applyQwenThinkingParams(true); + } }} >