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: keep Queue while the prompt queue is paused
Chaitanya Laxmanc76a3c0d5cf9
diff --git a/studio/frontend/src/components/assistant-ui/thread.tsx b/studio/frontend/src/components/assistant-ui/thread.tsxindex 37fbaeba982..03f966975f0 100644--- a/studio/frontend/src/components/assistant-ui/thread.tsx+++ b/studio/frontend/src/components/assistant-ui/thread.tsx@@ -1237,7 +1237,6 @@ function startPromptQueue(if (existingRun.deepResearchConsumed) {target.consumeDeepResearch();}- existingRun.paused = false;existingRun.items.push(...filtered.map((prompt) => createQueuedPrompt(prompt, target)),);@@ -1562,17 +1561,13 @@ interface PromptQueueCallbacks {onAborted?: () => void,) => boolean;stopQueue: () => void;- resumeQueue: () => void;}const noopStartPromptQueue: PromptQueueCallbacks["startQueue"] = () =>false;const noopStopPromptQueue: PromptQueueCallbacks["stopQueue"] = () => undefined;-const noopResumePromptQueue: PromptQueueCallbacks["resumeQueue"] = () =>- undefined;const PromptQueueContext = createContext<PromptQueueCallbacks>({startQueue: noopStartPromptQueue,stopQueue: noopStopPromptQueue,- resumeQueue: noopResumePromptQueue,});// Gap (px) between last message and floating composer; bottom spacer tracks@@ -4781,11 +4776,7 @@ const Composer: FC<{[aui, startHydratedPromptQueue, threadIsRunning, disableQueue],);- const queueContextValue: PromptQueueCallbacks = {- startQueue,- stopQueue,- resumeQueue,- };+ const queueContextValue: PromptQueueCallbacks = { startQueue, stopQueue };const composerContent = (<>@@ -6760,7 +6751,7 @@ const ComposerRightControls: FC<{</AuiIf>{isQueueRunning && !isResearchActive ? (<AuiIf condition={({ thread }) => !thread.isRunning}>- {queueEntry?.paused ? (+ {queueEntry?.paused && queueDisabled ? (<TooltipIconButtontooltip="Resume queue"side="bottom"@@ -6773,7 +6764,7 @@ const ComposerRightControls: FC<{><FastForwardIcon className="size-[18px] stroke-2" /></TooltipIconButton>- ) : queueEntry?.dispatched ? (+ ) : queueEntry?.dispatched && !queueEntry.paused ? (<Buttontype="button"variant="default"diff --git a/studio/frontend/tests/prompt-queue-user-stop.test.ts b/studio/frontend/tests/prompt-queue-user-stop.test.tsindex edaf173b184..c5fbbaa334d 100644--- a/studio/frontend/tests/prompt-queue-user-stop.test.ts+++ b/studio/frontend/tests/prompt-queue-user-stop.test.ts@@ -48,18 +48,18 @@ const plans: Array<{index: 0,want: { cancelActiveItem: true, retainedItemIndexes: [], pause: false },},- {- name: "an undispatched stop keeps the whole queue and pauses",- items: [{ dispatched: false }, { dispatched: false }],- index: 0,- want: { cancelActiveItem: false, retainedItemIndexes: [0, 1], pause: true },- },{name: "a queue still waiting to start is paused without cancelling",items: [{ dispatched: false }, { dispatched: false }],index: -1,want: { cancelActiveItem: false, retainedItemIndexes: [0, 1], pause: true },},+ {+ name: "completed history without follow-ups is retained and not paused",+ items: [{ dispatched: true }, { dispatched: true }, { dispatched: true }],+ index: 2,+ want: { cancelActiveItem: true, retainedItemIndexes: [0, 1], pause: false },+ },];for (const entry of plans) {diff --git a/tests/studio/test_prompt_queue_user_stop.py b/tests/studio/test_prompt_queue_user_stop.pyindex e39d28008f2..06e59021cad 100644--- a/tests/studio/test_prompt_queue_user_stop.py+++ b/tests/studio/test_prompt_queue_user_stop.py@@ -1,8 +1,6 @@# SPDX-License-Identifier: AGPL-3.0-only# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0-"""Composer stop pauses the queue; delete/archive still delete it."""-from pathlib import PathTHREAD = (@@ -11,34 +9,14 @@ THREAD = ().read_text(encoding = "utf-8")-def _between(source: str, start: str, end: str) -> str:- assert start in source, f"missing start marker: {start}"- tail = source.split(start, 1)[1]- assert end in tail, f"missing end marker after {start}: {end}"- return tail.split(end, 1)[0]---def test_composer_stop_pauses_without_permanently_cancelling_the_target():- pause = _between(- THREAD,- "function pausePromptQueueRun(threadIds?: string[])",- "function resumePromptQueueRun(threadIds?: string[])",- )- assert "userStopTargetCancelMode(plan)" in pause- assert "cancelActiveRun()" in pause+def test_composer_stop_pauses_and_delete_still_deletes():assert "pausePromptQueueRun(promptQueueThreadIds)" in THREAD+ assert "cancelActiveRun()" in THREADassert 'aria-label="Resume queue"' in THREAD- stop = _between(- THREAD,- "function stopPromptQueueRun(threadIds?: string[])",- "function stopPromptQueueRunForThreadIds(threadIds: string[])",- )+ stop = THREAD.split("function stopPromptQueueRun(threadIds?: string[])", 1)[1]+ stop = stop.split("function stopPromptQueueRunForThreadIds", 1)[0]assert "planUserPromptQueueStop(" not in stop- assert "deletePromptQueueRun(run);" in stop- listener = _between(- THREAD,- "window.addEventListener(PROMPT_QUEUE_STOP_EVENT",- "window.addEventListener(PROMPT_QUEUE_RUN_FAILED_EVENT",- )+ listener = THREAD.split("window.addEventListener(PROMPT_QUEUE_STOP_EVENT", 1)[1]+ listener = listener.split("window.addEventListener(PROMPT_QUEUE_RUN_FAILED_EVENT", 1)[0]assert "stopPromptQueueRunForThreadIds(threadIds)" in listenerassert "pausePromptQueueRun(" not in listener