From d55dc4a2684684d855d997c5a8bb57aea0ffe785 Mon Sep 17 00:00:00 2001 From: wenil Date: Thu, 9 Jul 2026 22:46:27 +0300 Subject: [PATCH] daemon: fix control-panel server crash in the windowed frozen exe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The onefile build is windowed (no console), so sys.stderr is None and uvicorn's default logging dictConfig fails with "Unable to configure formatter 'default'", which took the whole settings-panel server down (the BLE side kept working, but the Settings window couldn't load). Pass log_config=None so uvicorn skips its own logging setup — the daemon has its own file logger and doesn't need uvicorn's. Co-Authored-By: Claude Opus 4.8 --- daemon/server.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/daemon/server.py b/daemon/server.py index 667a2fe..1f285ea 100644 --- a/daemon/server.py +++ b/daemon/server.py @@ -153,8 +153,13 @@ def serve_in_thread(port: int | None = None) -> threading.Thread: import uvicorn p = port or cfgmod.DEFAULT_PORT + # log_config=None disables uvicorn's default dictConfig. In the frozen, + # windowed exe there is no console, so sys.stderr is None and uvicorn's + # default logging setup dies with "Unable to configure formatter 'default'", + # taking the whole control-panel server down. We don't need uvicorn's logs + # (the daemon has its own file logger), so skip its logging config entirely. server = uvicorn.Server(uvicorn.Config( - app, host="127.0.0.1", port=p, log_level="warning")) + app, host="127.0.0.1", port=p, log_level="warning", log_config=None)) t = threading.Thread(target=server.run, daemon=True, name="clawd-http") t.start() return t