diff --git a/app/api/routers/system.py b/app/api/routers/system.py index 8df2187..323db7e 100644 --- a/app/api/routers/system.py +++ b/app/api/routers/system.py @@ -87,7 +87,13 @@ def get_system_status() -> SystemStatusOut: except Exception: pass - ollama_ok = _ensure_client() + # bool(), because _ensure_client() has three return values, not two: True and + # False when Ollama is enabled and reachable/unreachable, and None when + # USE_OLLAMA is false - it returns before it ever probes. ollama_connected is + # typed bool, so that None failed response_model validation and turned the + # whole endpoint into a 500 on exactly the configuration this deployment + # runs (USE_OLLAMA=false). "Ollama is switched off" is not a server error. + ollama_ok = bool(_ensure_client()) dist_ok = FRONTEND_DIST.exists() and (FRONTEND_DIST / "index.html").exists() return SystemStatusOut(