From d212038ce20f2e6686a27932756369efd099a796 Mon Sep 17 00:00:00 2001 From: Haewon Kam Date: Tue, 3 Nov 2026 14:20:12 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20watchdog=20=EA=B2=8C=EC=9D=B4=ED=8A=B8?= =?UTF-8?q?=20=ED=9B=85=EC=9D=B4=20=EB=8F=99=EA=B8=B0=20=EA=B2=B0=EA=B3=BC?= =?UTF-8?q?=20=EB=81=9D=EC=9D=98=20=ED=95=98=EB=84=A4=EC=8A=A4=20=EA=BC=AC?= =?UTF-8?q?=EB=A6=AC(agentId=20=EC=A4=84,=20usage)=EB=A5=BC=20=EB=96=BC?= =?UTF-8?q?=EA=B3=A0=20=ED=8C=90=EC=A0=95=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 동기 Agent 결과는 WATCHDOG 판정 뒤에 agentId· 줄이 붙어 "마지막 줄 = PASS" 판정이 항상 실패했다. 마지막 줄 규칙과 FIX 혼재 차단, 검토 1회 = 초안 1회 규칙은 그대로 둔다. Co-Authored-By: Claude Opus 5.5 --- .claude/hooks/watchdog_gate.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.claude/hooks/watchdog_gate.py b/.claude/hooks/watchdog_gate.py index 6ff20b0..61e5c1f 100644 --- a/.claude/hooks/watchdog_gate.py +++ b/.claude/hooks/watchdog_gate.py @@ -39,7 +39,14 @@ def result_text(item): def verdict(text): # 판정은 결과의 마지막 비어 있지 않은 줄이 정확히 "WATCHDOG: PASS" 일 때만 인정한다 (본문 중간 인용·FIX 혼재 차단) - lines = [l.strip() for l in text.replace("\\n", "\n").splitlines() if l.strip()] + # 백그라운드 알림은 뒤에 · 이 붙으므로 본문만 본다 + text = text.replace("\\n", "\n") + m = re.search(r"(.*?)", text, re.S) + if m: + text = m.group(1) + # 동기 결과는 판정 뒤에 하네스 꼬리(agentId: … 줄, …)가 붙는다. 꼬리만 떼고 마지막 줄 규칙은 그대로 둔다 + text = re.sub(r".*?", "", text, flags=re.S) + lines = [l.strip() for l in text.splitlines() if l.strip() and not l.strip().startswith("agentId:")] if not lines: return False last = re.sub(r"[`*_<>/]|result", "", lines[-1]).strip()