diff --git a/aria-brain/proxy_client.py b/aria-brain/proxy_client.py index fb9c95f..c86cb7a 100644 --- a/aria-brain/proxy_client.py +++ b/aria-brain/proxy_client.py @@ -111,6 +111,20 @@ class ProxyClient: msg = choices[0].get("message") or {} finish_reason = choices[0].get("finish_reason", "") + # Diagnose: was hat der Proxy zurueckgegeben? + # Wir loggen die rohe message + finish_reason damit wir sehen ob + # tool_calls da sind, leer oder schlicht weggeschnitten werden. + logger.info("Proxy ← finish=%s keys=%s tool_calls=%d content_len=%d", + finish_reason, + sorted(msg.keys()), + len(msg.get("tool_calls") or []), + len(msg.get("content") or "") if isinstance(msg.get("content"), str) + else sum(len(p.get("text", "")) for p in (msg.get("content") or []) if isinstance(p, dict))) + try: + logger.info("Proxy ← raw-msg=%s", json.dumps(msg)[:1500]) + except Exception: + logger.info("Proxy ← raw-msg(non-serial)=%s", str(msg)[:1500]) + content = msg.get("content") or "" if isinstance(content, list): content = "".join(