From 84f6d3682c3c9b1c8803ad9b8383f07f33d473a6 Mon Sep 17 00:00:00 2001 From: m3taversal Date: Thu, 23 Apr 2026 11:24:16 +0100 Subject: [PATCH] fix(eval): treat empty diff as conservative fallback in auto-close gate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ganymede review nit: if get_pr_diff returns an empty string (edge case — Forgejo quirk, empty PR), the old `if diff is None` branch would miss it, the `elif diff and ...` would evaluate False (empty string is falsy), and control would fall to `else` — triggering auto-close on zero diff content. Change `if diff is None` → `if not diff` so empty string ALSO falls through to the conservative path. Matches the stated posture: skip auto-close when in doubt. Co-Authored-By: Claude Opus 4.7 (1M context) --- lib/eval_actions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/eval_actions.py b/lib/eval_actions.py index c84659c..dba5353 100644 --- a/lib/eval_actions.py +++ b/lib/eval_actions.py @@ -167,10 +167,10 @@ async def dispose_rejected_pr(conn, pr_number: int, eval_attempts: int, all_issu ) diff = None - if diff is None: - # Conservative: fall through to attempt-count branches below + if not diff: + # None or empty — conservative fallback, fall through to attempt-count branches pass - elif diff and "new file mode" not in diff: + elif "new file mode" not in diff: logger.info( "PR #%d: near_duplicate but modifies-only (enrichment) — skipping auto-close", pr_number,