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
Repair four checks that are red on main itself (#11456)
Daniel Hana17926b05574
diff --git a/studio/backend/tests/test_reset_password_command.py b/studio/backend/tests/test_reset_password_command.pyindex c190534f314..f8f701ceae1 100644--- a/studio/backend/tests/test_reset_password_command.py+++ b/studio/backend/tests/test_reset_password_command.py@@ -162,7 +162,7 @@ def test_the_console_warnings_name_the_absolute_command(monkeypatch, tmp_path):`unsloth` on PATH is left with a hint they cannot run. These two warnings go to the host's ownconsole, so naming the install there costs nothing and is the point."""- run_py = (Path(__file__).resolve().parents[1] / "run.py").read_text()+ run_py = (Path(__file__).resolve().parents[1] / "run.py").read_text(encoding = "utf-8")tree = ast.parse(run_py)calls = sum(diff --git a/studio/frontend/smoke-ansi-main.tsx b/studio/frontend/smoke-ansi-main.tsxindex 8c930aee450..2ae13b0ade0 100644--- a/studio/frontend/smoke-ansi-main.tsx+++ b/studio/frontend/smoke-ansi-main.tsx@@ -2,6 +2,12 @@// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0import { createRoot } from "react-dom/client";+// The app mounts every one of these components inside the provider tree in app/provider.tsx.+// This page mounts them bare, so any context they depend on has to be supplied here too, and+// a missing one is not a small thing: `Tooltip` throws outside its provider, which takes the+// whole React root down and leaves every section below empty. #11425 gave the code cell an+// icon button with a tooltip, and CodeExecutionResultOutput renders it.+import { TooltipProvider } from "@/components/ui/tooltip";import { ToolResultOutput } from "@/components/assistant-ui/tool-result-output";import { ToolFallbackResult } from "@/components/assistant-ui/tool-fallback";@@ -21,7 +27,7 @@ if (!root) {}createRoot(root).render(- <>+ <TooltipProvider><section data-smoke="tool-result-output"><h1>ToolResultOutput</h1><ToolResultOutput text={coloured} />@@ -44,5 +50,5 @@ createRoot(root).render(</section>- </>,+ </TooltipProvider>,);diff --git a/tests/studio/_playwright_robust.py b/tests/studio/_playwright_robust.pyindex ddc17a2e78f..f894f836d98 100644--- a/tests/studio/_playwright_robust.py+++ b/tests/studio/_playwright_robust.py@@ -486,15 +486,28 @@ def is_benign_console_error(msg: str) -> bool:return any(p in msg for p in BENIGN_CONSOLE_ERROR_PATTERNS)-def echo_browser_errors(page: Any, info: Callable[[str], None]) -> None:+def echo_browser_errors(page: Any, info: Callable[[str], None]) -> list[str]:"""Print what the browser knows, live, as it happens.A harness that only asserts on the DOM cannot tell an entry module that threwfrom one that is merely slow: both end as an `expect(...)` timeout on a locatorthat was never created, under an empty CI log. The smokes each own a throwawaypage, so printing straight through beats collecting for a caller to forward.++ The uncaught errors are also RETURNED, because printing alone still leaves the+ failure itself unreadable. A React root that throws renders nothing, so every+ locator misses and the smoke fails 15 seconds later as "element(s) not found"+ with the real cause sitting further up an otherwise green-looking log. A caller+ that checks this list can say what actually happened instead. Returning is+ additive: callers that ignore it behave exactly as before."""- page.on("pageerror", lambda e: info(f"pageerror: {e}"))+ thrown: list[str] = []++ def record(error: Any) -> None:+ thrown.append(str(error))+ info(f"pageerror: {error}")++ page.on("pageerror", record)page.on("console",lambda m: info(f"console.{m.type}: {m.text}") if m.type == "error" else None,@@ -506,6 +519,7 @@ def echo_browser_errors(page: Any, info: Callable[[str], None]) -> None:"framenavigated",lambda f: info(f"navigated: {f.url}") if f is page.main_frame else None,)+ return thrown# ─────────────────────────────────────────────────────────────────────diff --git a/tests/studio/install/test_selection_logic.py b/tests/studio/install/test_selection_logic.pyindex cd72da7b4bb..93a9dde81cb 100644--- a/tests/studio/install/test_selection_logic.py+++ b/tests/studio/install/test_selection_logic.py@@ -5028,7 +5028,7 @@ class TestUpstreamDigestKeepsTheFunctionalSmokeTest:would validate upstream attempts with an unresolved probe, which the probe gates'own comments say demotes a healthy GPU pick to CPU."""- source = pathlib.Path(INSTALL_LLAMA_PREBUILT.__file__).read_text()+ source = pathlib.Path(INSTALL_LLAMA_PREBUILT.__file__).read_text(encoding = "utf-8")stale = [line.strip()for line in source.splitlines()diff --git a/tests/studio/playwright_strip_ansi_smoke.py b/tests/studio/playwright_strip_ansi_smoke.pyindex c424aa8fc2a..23e53135fba 100644--- a/tests/studio/playwright_strip_ansi_smoke.py+++ b/tests/studio/playwright_strip_ansi_smoke.py@@ -78,7 +78,7 @@ def main() -> None:launch_args = chromium_launch_args() if browser_name == "chromium" else []browser = browser_type.launch(headless = True, args = launch_args)page = browser.new_page()- echo_browser_errors(page, info)+ thrown = echo_browser_errors(page, info)try:page.goto(f"{BASE}/smoke-ansi.html", wait_until = "networkidle")page.screenshot(path = str(ART / "smoke-ansi.png"), full_page = True)@@ -95,6 +95,16 @@ def main() -> None:assert "[32m" not in text, f"{section} still shows SGR garbage"except Exception:dump(page, vite)+ # Say what the page threw, if anything. The smoke renders these components+ # bare, outside the app's providers, so a component that grows a new context+ # dependency takes the whole React root down and every pane below goes+ # missing. Reported as a timeout on the first locator, that reads as a slow+ # build; it is not. The missing provider is the thing to name.+ if thrown:+ raise AssertionError(+ "the smoke page threw before rendering, so no pane exists to check: "+ + "; ".join(dict.fromkeys(thrown))+ )raiseinfo("all production panes rendered clean text (no ANSI escapes)")diff --git a/tests/studio/test_multi_chat_prompt_queue_contract.py b/tests/studio/test_multi_chat_prompt_queue_contract.pyindex 6ac33a8ce5b..58031b760cc 100644--- a/tests/studio/test_multi_chat_prompt_queue_contract.py+++ b/tests/studio/test_multi_chat_prompt_queue_contract.py@@ -6,6 +6,8 @@import refrom pathlib import Path+from tests.studio._js_source import gates_the_markup+REPO = Path(__file__).resolve().parents[2]FRONTEND = REPO / "studio/frontend/src"@@ -1027,7 +1029,15 @@ def test_sidebar_exposes_queue_activity_for_each_thread():assert "const queueByThreadId = usePromptQueueUI((s) => s.byThreadId);" in APP_SIDEBARassert "hasQueuedActivity" in APP_SIDEBARassert "showWorkSpinner" in APP_SIDEBAR- assert "{showWorkSpinner && (" in APP_SIDEBAR+ # That it gates mounted markup, not that it does so with `&&`. #11408 moved the spinner to+ # the trailing column and wrote the gate as `{showWorkSpinner ? (`, which renders the same+ # element under the same condition, and pinning the `&&` spelling failed a correct change.+ # `showWorkSpinner` also picks class strings in this file, so a plain substring search would+ # go on passing once the spinner itself stopped being rendered; this asks for the gate.+ assert gates_the_markup(APP_SIDEBAR, "showWorkSpinner"), (+ "app-sidebar.tsx no longer mounts anything under showWorkSpinner, so a working chat "+ "row shows no spinner however much room it reserves for one"+ )assert "hasUnreadActivity" in APP_SIDEBARassert "clearChatNotifications(item)" in APP_SIDEBAR