Skip to content

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.

Studio: default Deep Research to no time limit per model request (#15983)

Nilayd769846b23f7
diff --git a/studio/backend/routes/research_runs.py b/studio/backend/routes/research_runs.py
index fe027081bc5..0f1a7de1ba5 100644
--- a/studio/backend/routes/research_runs.py
+++ b/studio/backend/routes/research_runs.py
@@ -455,7 +455,7 @@ def _sanitize_config(
budgets = {
"maxSteps": 12,
"maxSources": 40,
- "modelTimeoutSeconds": 900,
+ "modelTimeoutSeconds": 0,
"toolTimeoutSeconds": 120,
"firstOutputTimeoutSeconds": 120,
}
diff --git a/studio/backend/tests/test_research_runs_storage.py b/studio/backend/tests/test_research_runs_storage.py
index f0c37eb2420..65eddd0ef56 100644
--- a/studio/backend/tests/test_research_runs_storage.py
+++ b/studio/backend/tests/test_research_runs_storage.py
@@ -1459,7 +1459,7 @@ def test_research_budget_defaults_support_long_runs():
assert config["budgets"] == {
"maxSteps": 12,
"maxSources": 40,
- "modelTimeoutSeconds": 900,
+ "modelTimeoutSeconds": 0,
"toolTimeoutSeconds": 120,
"firstOutputTimeoutSeconds": 120,
}
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.tsx
index 513b1f92049..756ff016a53 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
@@ -28,7 +28,6 @@ import {
type ResearchMcpTool,
} from "../api/mcp-servers-api";
import {
- DEFAULT_RESEARCH_MODEL_TIMEOUT_SECONDS,
MAX_RESEARCH_MCP_SOURCES,
useChatRuntimeStore,
} from "../stores/chat-runtime-store";
@@ -42,6 +41,7 @@ import type {
const MAX_RESEARCH_MODEL_TIMEOUT_MINUTES = Math.floor(
MAX_RESEARCH_MODEL_TIMEOUT_SECONDS / 60,
);
+const LIMITED_RESEARCH_MODEL_TIMEOUT_SECONDS = 15 * 60;
function normalizeDomain(raw: string): string | null {
const value = raw.trim();
@@ -376,11 +376,10 @@ function DeepResearchWebsiteAccessContent({
const [draft, setDraft] = useState<ResearchWebsitePolicy>(policy);
const [mcpDraft, setMcpDraft] = useState<ResearchMcpSource[]>(mcpSources);
const [unlimited, setUnlimited] = useState(modelTimeoutSeconds === 0);
- // re-enabling the limit from unlimited starts at the default.
const [timeoutMinutes, setTimeoutMinutes] = useState(
String(
Math.ceil(
- (modelTimeoutSeconds || DEFAULT_RESEARCH_MODEL_TIMEOUT_SECONDS) / 60,
+ (modelTimeoutSeconds || LIMITED_RESEARCH_MODEL_TIMEOUT_SECONDS) / 60,
),
),
);
@@ -468,16 +467,16 @@ function DeepResearchWebsiteAccessContent({
setPolicy(draft);
setMcpSources(mcpDraft);
const minutes = Number(timeoutMinutes);
- // typed values bypass max; clamp to avoid a short default timeout.
- setModelTimeoutSeconds(
- unlimited
- ? 0
- : !timeoutEdited
- ? modelTimeoutSeconds
+ // An untouched value stays unstored so it follows the default; typed values bypass max, so clamp.
+ if (timeoutEdited) {
+ setModelTimeoutSeconds(
+ unlimited
+ ? 0
: Number.isSafeInteger(minutes) && minutes >= 1
? Math.min(minutes, MAX_RESEARCH_MODEL_TIMEOUT_MINUTES) * 60
- : DEFAULT_RESEARCH_MODEL_TIMEOUT_SECONDS,
- );
+ : LIMITED_RESEARCH_MODEL_TIMEOUT_SECONDS,
+ );
+ }
onClose();
}}
>
diff --git a/studio/frontend/src/features/chat/stores/chat-runtime-store.ts b/studio/frontend/src/features/chat/stores/chat-runtime-store.ts
index 48ee03cd906..8d4d3985e57 100644
--- a/studio/frontend/src/features/chat/stores/chat-runtime-store.ts
+++ b/studio/frontend/src/features/chat/stores/chat-runtime-store.ts
@@ -223,7 +223,7 @@ export const DEFAULT_RESEARCH_WEBSITE_POLICY: ResearchWebsitePolicy = {
allowedDomains: [],
blockedDomains: [],
};
-export const DEFAULT_RESEARCH_MODEL_TIMEOUT_SECONDS = 900;
+export const DEFAULT_RESEARCH_MODEL_TIMEOUT_SECONDS = 0;
/** The patch and run routes reject anything other than 0 or a finite budget with 400. */
function isSupportedResearchModelTimeout(value: number): boolean {
diff --git a/studio/frontend/tests/deep-research-dialog.test.ts b/studio/frontend/tests/deep-research-dialog.test.ts
index 5ef4019a2db..735c1d457b8 100644
--- a/studio/frontend/tests/deep-research-dialog.test.ts
+++ b/studio/frontend/tests/deep-research-dialog.test.ts
@@ -14,6 +14,12 @@ test("a Deep research domain list is one field, not a pill inside a pill", () =>
assert.match(list, /<input\b/);
});
+test("Save limits stores the time limit only when it was edited", () => {
+ const save = RESEARCH.slice(RESEARCH.indexOf("setMcpSources(mcpDraft);"), RESEARCH.indexOf("Save limits"));
+ assert.match(save, /if \(timeoutEdited\) \{\s*setModelTimeoutSeconds\(/);
+ assert.equal(save.match(/setModelTimeoutSeconds\(/g)?.length, 1);
+});
+
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 : \(/);
diff --git a/studio/frontend/tests/research-model-timeout-bounds.test.ts b/studio/frontend/tests/research-model-timeout-bounds.test.ts
index 83990767c84..daaf68f60f8 100644
--- a/studio/frontend/tests/research-model-timeout-bounds.test.ts
+++ b/studio/frontend/tests/research-model-timeout-bounds.test.ts
@@ -27,6 +27,10 @@ test("the cap matches the ceiling the backend payload enforces", () => {
assert.equal(MAX_RESEARCH_MODEL_TIMEOUT_SECONDS, 365 * 24 * 3600);
});
+test("a fresh store has no limit on a Deep Research model request", () => {
+ assert.equal(useChatRuntimeStore.getState().researchModelTimeoutSeconds, 0);
+});
+
test("the mirrored patch keeps the cap and drops one second past it", () => {
const atCap: PersistedChatSettings = {};
assignSanitizedMirroredSettings(