From 1cd9c5d45537d34621c8982a9937ca84793237ea Mon Sep 17 00:00:00 2001 From: pyr0ball Date: Tue, 5 May 2026 21:01:32 -0700 Subject: [PATCH] fix: move json import to module scope in nodes.py --- app/nodes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/nodes.py b/app/nodes.py index f1c3c50..51114ad 100644 --- a/app/nodes.py +++ b/app/nodes.py @@ -10,6 +10,7 @@ Module-level globals follow the set_config_dir() testability pattern from cforch """ from __future__ import annotations +import json import logging import os from pathlib import Path @@ -335,7 +336,6 @@ def pull_ollama_model(node_id: str, body: PullRequest) -> StreamingResponse: if line: yield f"data: {line}\n\n" except Exception as exc: - import json yield f"data: {json.dumps({'error': str(exc)})}\n\n" return StreamingResponse(stream(), media_type="text/event-stream")