fix: wordpress_client.init(cfg) vor format_overview aufrufen

Ohne init() sind WP_URL und WP_PASSWORD noch leer.

Made-with: Cursor
This commit is contained in:
root 2026-03-09 13:14:29 +07:00
parent 4428730807
commit 02a645bc33

View file

@ -133,6 +133,7 @@ def gather_context_for_question(question: str) -> str:
"""Sammelt relevanten Kontext für eine Freitext-Frage."""
q = question.lower()
parts = []
cfg = _load_config()
if any(w in q for w in ["fehler", "error", "problem", "kaputt", "down"]):
parts.append("=== Aktuelle Fehler ===\n" + gather_errors(hours=2))
@ -145,7 +146,7 @@ def gather_context_for_question(question: str) -> str:
# WordPress-Daten für Blog-Fragen
if any(w in q for w in ["wordpress", "blog", "post", "artikel", "kommentar", "plugin"]):
cfg = _load_config()
wordpress_client.init(cfg) # WICHTIG: Init vor Format_overview
wp_overview = wordpress_client.format_overview(cfg)
parts.append("=== WordPress ===\n" + wp_overview)