feat: GLM 디버그 정보 출력 개선

- `_glm_debug_enabled()`가 활성화된 경우, JSON 응답에서 `finish_reason`을 출력하도록 로직 추가하여 디버깅 정보 강화
- 디버그 출력에 대한 가독성을 높여 문제 해결 시 유용한 정보 제공
This commit is contained in:
kswdev0
2026-03-26 11:52:31 +09:00
parent 3e90090b5e
commit e0ca8f7b52

View File

@@ -334,6 +334,9 @@ class AIPlanner:
t_json0 = time.perf_counter()
data = json.loads(raw_text)
if _glm_debug_enabled():
finish_reason = data.get("choices", [{}])[0].get("finish_reason")
print(f"[GLM][디버그] finish_reason={finish_reason!r}")
content = self._extract_glm_assistant_text(data).strip()
if not content and _glm_debug_enabled():
# content가 비어있으면 아래 파서에서 원인 추적이 어려워지므로 raw 일부를 남긴다.