fix clear investi

This commit is contained in:
larssand
2026-07-06 16:49:30 +02:00
parent 49ac7e2958
commit 649c29a8c2
8 changed files with 88 additions and 7 deletions

View File

@@ -742,6 +742,7 @@ def monitor_loop(
runtime = ConfigStore(config_path).read() if config_path and Path(config_path).exists() else {}
effective_llm = bool(runtime.get("llm_enabled")) if runtime else llm
effective_model = str(runtime.get("llm_model") or llm_model or "")
effective_llm_timeout = int(runtime.get("llm_timeout") or llm_timeout or 180)
mcp_call_timeout = max(1, int(runtime.get("graylog_mcp_call_timeout_seconds", 8) or 8))
mcp_poll_timeout = max(60, int(runtime.get("graylog_mcp_poll_timeout_seconds", 240) or 240))
if runtime.get("log_source") == "graylog_mcp":
@@ -779,15 +780,13 @@ def monitor_loop(
StatusSnapshotStore(status_cache_path).save("last_good", status)
write_status(status, output)
now = int(time.time())
if runtime.get("profile_advisor_enabled"):
add_profile_advisor(status, runtime)
write_status(status, output)
if now - last_llm_at >= llm_interval:
add_llm_assessment(status, previous=last_llm_text, model=effective_model or None, timeout=llm_timeout)
add_llm_assessment(status, previous=last_llm_text, model=effective_model or None, timeout=effective_llm_timeout)
assessment = status.get("llm_assessment", {})
if isinstance(assessment, dict):
last_llm_text = str(assessment.get("text", "") or last_llm_text or "")
last_llm_at = now
write_status(status, output)
else:
status["llm_assessment"] = {
"enabled": True,
@@ -795,6 +794,9 @@ def monitor_loop(
"generated_at": last_llm_at,
"text": last_llm_text or "",
}
if runtime.get("profile_advisor_enabled"):
add_profile_advisor(status, runtime)
write_status(status, output)
else:
status["llm_assessment"] = {"enabled": False, "status": "disabled", "text": ""}
if runtime.get("profile_advisor_enabled"):