fix(eval): treat empty diff as conservative fallback in auto-close gate
Some checks are pending
CI / lint-and-test (push) Waiting to run

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) <noreply@anthropic.com>
This commit is contained in:
m3taversal 2026-04-23 11:24:16 +01:00
parent 33c17f87a8
commit 84f6d3682c

View file

@ -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,