diff --git a/src/routers/incidents.py b/src/routers/incidents.py index d69663d..b2f03c1 100644 --- a/src/routers/incidents.py +++ b/src/routers/incidents.py @@ -232,6 +232,11 @@ async def enhance_description( # call_claude erzwingt bei tools=None JSON-Output — # Haiku wrapped den Text dann in ein JSON-Objekt (oft verschachtelt) text = result.strip() + # Markdown-Code-Block-Wrapper entfernen + import re as _re + _md = _re.search(r'`{3}(?:json)?\s*\n?(.*?)\n?\s*`{3}', text, _re.DOTALL) + if _md: + text = _md.group(1).strip() try: import json as _json parsed = _json.loads(text)