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.

refactor: improve dialog rendering and logging setup for stability and configurability

Shine1i91cbb0e9337f
diff --git a/studio/backend/core/data_recipe/jobs/worker.py b/studio/backend/core/data_recipe/jobs/worker.py
index 3f105132ab1..c39ef286c45 100644
--- a/studio/backend/core/data_recipe/jobs/worker.py
+++ b/studio/backend/core/data_recipe/jobs/worker.py
@@ -66,19 +66,8 @@ def run_job_process(
event_queue.put({"type": "job.started", "ts": time.time()})
try:
- # Importing data_designer.interface.* triggers DataDesigner logging setup (it clears root handlers),
- # so attach our queue handler after that import.
from data_designer.config.run_config import RunConfig
- import data_designer.interface.data_designer # noqa: F401
-
- handler = _QueueLogHandler(event_queue)
- handler.setLevel(logging.INFO)
- root = logging.getLogger()
- root.addHandler(handler)
- root.setLevel(logging.INFO)
- logging.getLogger("data_designer").setLevel(logging.INFO)
-
rows = int(run.get("rows") or 1000)
dataset_name = str(run.get("dataset_name") or "dataset")
artifact_path_raw = run.get("artifact_path")
@@ -90,6 +79,15 @@ def run_job_process(
builder = build_config_builder(recipe)
designer = create_data_designer(recipe, artifact_path=artifact_path)
+ # DataDesigner configures root logging in DataDesigner.__init__.
+ # Attach queue logger directly to `data_designer` so parser events survive root resets.
+ handler = _QueueLogHandler(event_queue)
+ handler.setLevel(logging.INFO)
+ data_designer_logger = logging.getLogger("data_designer")
+ data_designer_logger.addHandler(handler)
+ data_designer_logger.setLevel(logging.INFO)
+ data_designer_logger.propagate = True
+
if run_config_raw:
designer.set_run_config(RunConfig.model_validate(run_config_raw))
diff --git a/studio/frontend/src/features/recipe-studio/api/index.ts b/studio/frontend/src/features/recipe-studio/api/index.ts
index 7d2837abd02..a654580ef1b 100644
--- a/studio/frontend/src/features/recipe-studio/api/index.ts
+++ b/studio/frontend/src/features/recipe-studio/api/index.ts
@@ -188,7 +188,12 @@ function parseJobEvent(rawEvent: string): JobEvent | null {
if (dataLines.length === 0) {
return null;
}
- const payload = JSON.parse(dataLines.join("\n")) as Record<string, unknown>;
+ let payload: Record<string, unknown>;
+ try {
+ payload = JSON.parse(dataLines.join("\n")) as Record<string, unknown>;
+ } catch {
+ return null;
+ }
return {
event: eventName,
id,
diff --git a/studio/frontend/src/features/recipe-studio/blocks/render-dialog.tsx b/studio/frontend/src/features/recipe-studio/blocks/render-dialog.tsx
index 9192bb1cacb..0b930fb0ce4 100644
--- a/studio/frontend/src/features/recipe-studio/blocks/render-dialog.tsx
+++ b/studio/frontend/src/features/recipe-studio/blocks/render-dialog.tsx
@@ -18,6 +18,7 @@ import { UuidDialog } from "../dialogs/samplers/uuid-dialog";
export function renderBlockDialog(
config: NodeConfig | null,
+ open: boolean,
categoryOptions: SamplerConfig[],
modelConfigAliases: string[],
modelProviderOptions: string[],
@@ -34,7 +35,7 @@ export function renderBlockDialog(
switch (definition.dialogKey) {
case "seed":
return config.kind === "seed" ? (
- <SeedDialog config={config} onUpdate={update} />
+ <SeedDialog config={config} onUpdate={update} open={open} />
) : null;
case "category":
return config.kind === "sampler" && config.sampler_type === "category" ? (