From 48eb2abd8eba5eb1a912cb1ab8617bccfa7fd6b0 Mon Sep 17 00:00:00 2001 From: NoodleLDS Date: Tue, 2 Jun 2026 18:58:54 -0300 Subject: [PATCH] log(llm_core): add warnings to silent except Exception blocks - Malformed URL in _is_ollama_native_url now logs a warning so bad endpoint configs are traceable instead of silently returning False. - Model list fetch failure now logs a warning with the endpoint URL so endpoints that silently vanish from the model picker are diagnosable. --- src/llm_core.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/llm_core.py b/src/llm_core.py index 1338ef91a..cbfbeb834 100644 --- a/src/llm_core.py +++ b/src/llm_core.py @@ -283,7 +283,8 @@ def _is_ollama_native_url(url: str) -> bool: """Return True for native Ollama API URLs, including Ollama Cloud.""" try: parsed = urlparse(url or "") - except Exception: + except Exception as e: + logger.warning("Failed to parse URL for Ollama detection %r: %s", url, e) return False host = parsed.hostname or "" path = (parsed.path or "").rstrip("/") @@ -1345,8 +1346,8 @@ def list_model_ids( r = httpx.get(root + "/api/tags", timeout=timeout) r.raise_for_status() return [m.get("name") or m.get("model") for m in (r.json().get("models") or []) if m.get("name") or m.get("model")] - except Exception: - pass + except Exception as e: + logger.warning("Failed to fetch model list from endpoint %r: %s", base_chat_url, e) return [] def normalize_model_id(