From db08db62a370aabda824617482bab4c41c54896d Mon Sep 17 00:00:00 2001 From: kswdev0 Date: Thu, 26 Mar 2026 11:20:12 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20GLM=20=EB=94=94=EB=B2=84=EA=B7=B8=20?= =?UTF-8?q?=EC=A0=95=EB=B3=B4=20=EC=B6=9C=EB=A0=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - `_glm_debug_enabled()`가 활성화된 경우, content와 reasoning의 길이 및 JSON 유사성 여부를 포함한 디버그 정보를 출력하도록 로직 추가 - 디버깅을 위한 content 및 reasoning의 미리보기 문자열도 포함하여 문제 해결 시 유용한 정보 제공 --- ai_planner.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ai_planner.py b/ai_planner.py index 9e88e56..5b53fb2 100644 --- a/ai_planner.py +++ b/ai_planner.py @@ -391,6 +391,16 @@ class AIPlanner: content_stripped = content.strip() reasoning_stripped = reasoning.strip() + if _glm_debug_enabled(): + c_preview = (content_stripped[:120] + ("..." if len(content_stripped) > 120 else "")) + r_preview = (reasoning_stripped[:120] + ("..." if len(reasoning_stripped) > 120 else "")) + print( + "[GLM][디버그] extract_assistant_text | " + f"content_len={len(content_stripped)} reasoning_len={len(reasoning_stripped)} | " + f"content_looks_json={looks_like_json(content_stripped)} reasoning_looks_json={looks_like_json(reasoning_stripped)} | " + f"content_preview={c_preview!r} | reasoning_preview={r_preview!r}" + ) + if looks_like_json(content_stripped): return content_stripped if looks_like_json(reasoning_stripped):