Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Studio: cleaner Deep research limits dialog (#12632)
Michael Han642da4cef9c1
diff --git a/studio/frontend/src/features/chat/components/deep-research-composer-button.tsx b/studio/frontend/src/features/chat/components/deep-research-composer-button.tsxindex be0e20bf22b..3ba8df7aaf8 100644--- a/studio/frontend/src/features/chat/components/deep-research-composer-button.tsx+++ b/studio/frontend/src/features/chat/components/deep-research-composer-button.tsx@@ -13,6 +13,7 @@ import {DialogTitle,} from "@/components/ui/dialog";import { Input } from "@/components/ui/input";+import { Switch } from "@/components/ui/switch";import { cn } from "@/lib/utils";import { ChevronDownStandardIcon } from "@/lib/chevron-icons";import { XIcon } from "lucide-react";@@ -98,21 +99,23 @@ function DomainList({{description}</p></div>+ {/* One Input-styled field with the domains as chips. A click anywhere focuses it. */}<div+ onClick={(event) => event.currentTarget.querySelector("input")?.focus()}className={cn(- "flex min-h-10 flex-wrap items-center gap-1.5 rounded-2xl border border-input bg-input/20 p-1.5 transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50",- error && "border-destructive/70",+ "flex min-h-9 cursor-text flex-wrap items-center gap-1 rounded-[18px] border border-border bg-background px-1.5 py-[3px] transition-colors focus-within:border-ring dark:border-transparent dark:bg-[rgb(255_255_255_/_calc(0.06*var(--contrast-wash-gain,1)))] dark:focus-within:bg-[rgb(255_255_255_/_calc(0.12*var(--contrast-wash-gain,1)))]",+ error && "border-destructive ring-[3px] ring-destructive/20 dark:border-destructive/50",)}>{values.map((domain) => (<spankey={domain}- className="flex h-6 items-center gap-1 rounded-full bg-muted px-2 text-xs font-medium"+ className="flex h-7 items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--foreground)_calc(10%*var(--contrast-wash-gain,1)),transparent)] pl-2.5 pr-1.5 text-xs font-medium">{domain}<buttontype="button"- className="text-muted-foreground transition-colors hover:text-foreground"+ className="flex size-4 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-[color-mix(in_oklab,var(--foreground)_calc(10%*var(--contrast-wash-gain,1)),transparent)] hover:text-foreground"aria-label={`Remove ${domain}`}onClick={() =>onChange(values.filter((value) => value !== domain))@@ -122,7 +125,7 @@ function DomainList({</button></span>))}- <Input+ <inputvalue={draft}onChange={(event) => {setDraft(event.target.value);@@ -131,8 +134,9 @@ function DomainList({onBlur={addDraft}onKeyDown={handleKeyDown}placeholder={values.length ? "Add another domain" : "example.com"}+ aria-label={label}aria-invalid={Boolean(error)}- className="h-7 min-w-36 flex-1 border-0 bg-transparent px-1 shadow-none focus-visible:ring-0"+ className="h-7 min-w-32 flex-1 bg-transparent px-2 text-base outline-none placeholder:text-muted-foreground md:text-sm"/></div>{error ? <p className="text-xs text-destructive">{error}</p> : null}@@ -250,52 +254,62 @@ function DeepResearchWebsiteAccessContent({return (<DialogContent className="sm:max-w-lg"><DialogHeader>- <DialogTitle>Deep research</DialogTitle>+ {/* Icon and title, as in the Skills dialog. */}+ <div className="flex items-center gap-2">+ <HugeiconsIcon icon={Telescope02Icon} strokeWidth={1.75} className="size-5 text-primary" />+ <DialogTitle>Deep research</DialogTitle>+ </div><DialogDescription>Control website access and model request time for the next DeepResearch run.</DialogDescription></DialogHeader><div className="space-y-6">- <div className="space-y-2">- <div>- {/* A run makes many model requests, so this bounds each one, not the run. */}- <div className="text-sm font-medium">Time per model request</div>- <p className="mt-0.5 text-xs leading-relaxed text-muted-foreground">- {unlimited- ? "No limit on a single model request. Slow models can continue while they keep producing output."- : "Maximum time for each model request, so a run of many requests can take longer. Output stall safeguards stay active."}- </p>- </div>- <div className="flex gap-2">- <Input- type="number"- min="1"- max={MAX_RESEARCH_MODEL_TIMEOUT_MINUTES}- step="1"- value={timeoutMinutes}- disabled={unlimited}- onChange={(event) => {- setTimeoutEdited(true);- setTimeoutMinutes(event.target.value);- }}- aria-label="Deep Research time per model request in minutes"- className="w-28"- />- <span className="self-center text-sm text-muted-foreground">- minutes- </span>- <Button- type="button"- variant="outline"- onClick={() => {- setTimeoutEdited(true);- setUnlimited((value) => !value);- }}+ <div className="space-y-2.5">+ <div className="flex items-start justify-between gap-6">+ <div>+ {/* A run makes many model requests, so this bounds each one, not the run. */}+ <div className="text-sm font-medium">Time per model request</div>+ <p className="mt-0.5 text-xs leading-relaxed text-muted-foreground">+ {unlimited+ ? "No limit on a single model request. Slow models can continue while they keep producing output."+ : "Maximum time for each model request, so a run of many requests can take longer. Output stall safeguards stay active."}+ </p>+ </div>+ {/* A switch: it is a state, so its label never flips. */}+ <label+ htmlFor="research-no-time-limit"+ className="flex shrink-0 cursor-pointer items-center gap-2 pt-0.5 text-sm text-muted-foreground">- {unlimited ? "Use a limit" : "No limit"}- </Button>+ No limit+ <Switch+ id="research-no-time-limit"+ checked={unlimited}+ onCheckedChange={(checked) => {+ setTimeoutEdited(true);+ setUnlimited(checked);+ }}+ />+ </label></div>+ {unlimited ? null : (+ <div className="flex items-center gap-2.5">+ <Input+ type="number"+ min="1"+ max={MAX_RESEARCH_MODEL_TIMEOUT_MINUTES}+ step="1"+ value={timeoutMinutes}+ onChange={(event) => {+ setTimeoutEdited(true);+ setTimeoutMinutes(event.target.value);+ }}+ aria-label="Deep Research time per model request in minutes"+ className="w-24"+ />+ <span className="text-sm text-muted-foreground">minutes</span>+ </div>+ )}</div><DomainListlabel="Allow only"diff --git a/studio/frontend/tests/deep-research-dialog.test.ts b/studio/frontend/tests/deep-research-dialog.test.tsnew file mode 100644index 00000000000..5ef4019a2db--- /dev/null+++ b/studio/frontend/tests/deep-research-dialog.test.ts@@ -0,0 +1,22 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++import assert from "node:assert/strict";+import { readFile } from "node:fs/promises";+import test from "node:test";++const read = (path: string) => readFile(new URL(path, import.meta.url), "utf8");+const RESEARCH = await read("../src/features/chat/components/deep-research-composer-button.tsx");++test("a Deep research domain list is one field, not a pill inside a pill", () => {+ const list = RESEARCH.slice(RESEARCH.indexOf("function DomainList("), RESEARCH.indexOf("export function DeepResearchComposerButton("));+ assert.doesNotMatch(list, /<Input\b/);+ assert.match(list, /<input\b/);+});++test("Deep research's time limit is a switch, and its header carries the tool's icon", () => {+ assert.match(RESEARCH, /<Switch\s+id="research-no-time-limit"\s+checked=\{unlimited\}/);+ assert.match(RESEARCH, /\{unlimited \? null : \(/);+ assert.doesNotMatch(RESEARCH, /"Use a limit"/);+ assert.match(RESEARCH, /icon=\{Telescope02Icon\} strokeWidth=\{1\.75\} className="size-5 text-primary"/);+});