mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-17 10:15:27 -04:00
fix(logging): avoid logging raw URLs in llm_core error paths
Drop the raw url/base_chat_url from the Ollama-detection and model-list-fetch warning logs added by this sweep, since these values can contain private hostnames, internal IPs, credentials, or other deployment details. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
committed by
Alexandre Teixeira
parent
58bbbf1c1f
commit
170560fbcc
+2
-2
@@ -284,7 +284,7 @@ def _is_ollama_native_url(url: str) -> bool:
|
|||||||
try:
|
try:
|
||||||
parsed = urlparse(url or "")
|
parsed = urlparse(url or "")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.warning("Failed to parse URL for Ollama detection %r", url, exc_info=e)
|
logger.warning("Failed to parse URL for Ollama detection", exc_info=e)
|
||||||
return False
|
return False
|
||||||
host = parsed.hostname or ""
|
host = parsed.hostname or ""
|
||||||
path = (parsed.path or "").rstrip("/")
|
path = (parsed.path or "").rstrip("/")
|
||||||
@@ -1347,7 +1347,7 @@ def list_model_ids(
|
|||||||
r.raise_for_status()
|
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")]
|
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 as e:
|
except Exception as e:
|
||||||
logger.warning("Failed to fetch model list from endpoint %r", base_chat_url, exc_info=e)
|
logger.warning("Failed to fetch model list from configured endpoint", exc_info=e)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def normalize_model_id(
|
def normalize_model_id(
|
||||||
|
|||||||
Reference in New Issue
Block a user