fix: check issue state not labels in merged-PR catch-up

Closed issues can still have labels; the old `if not labels` guard
never fired for issue #272, so the loop retried the no-op close every
minute and never reached the ToPlan/Ready issue logic.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Thomas SharedInbox
2026-05-28 06:49:12 +02:00
co-authored by Claude Sonnet 4.6
parent 47fc534a8d
commit 91c86d72ef
+5 -3
View File
@@ -912,9 +912,11 @@ def _run_loop() -> int:
if not m:
continue
issue_num = int(m.group(1))
labels = _get_issue_labels(issue_num)
if not labels:
# Issue is likely already closed — skip.
try:
issue_data = _tea_get(f"/repos/{REPO}/issues/{issue_num}")
except RuntimeError:
continue
if issue_data.get("state") != "open":
continue
pr_number = pr["number"]
print(f"Catch-up (merged PR): PR #{pr_number} for issue #{issue_num} was merged — closing.")