claude-memory/graph/fixes/fix-cleanup-of-duplicate-labels-and-prs-from-issue-poller-in-91e8d0.md
2026-03-03 15:25:48 -06:00

2.2 KiB

id type title tags importance confidence created updated relations
91e8d0c6-74c0-472f-b123-d30123bfd009 fix Fix: Cleanup of duplicate labels and PRs from issue-poller infinite loop in paper-dynasty-database
paper-dynasty-database
gitea
cleanup
automation
duplicate-labels
claude-scheduled
0.5 0.8 2026-03-03T21:25:33.268899+00:00 2026-03-03T21:25:48.745118+00:00
target type direction strength edge_id
b27fb831-811e-4103-b5f1-3c36d5b1ad20 RELATED_TO outgoing 0.89 f7910c23-9fb8-45fd-993a-fe3413eef6bb
target type direction strength edge_id
4321bee8-105e-4fc8-b645-964d1234c966 RELATED_TO outgoing 0.87 19a46f8c-7b91-4453-8c62-2b31e6002764
target type direction strength edge_id
b27fb831 RELATED_TO outgoing 0.87 4061439f-7664-453a-acb3-c91e8e43f664
target type direction strength edge_id
c1a50fb8-9084-439d-a156-872bedb9013b CAUSES incoming 0.95 c250081e-5695-4789-b483-395a3f8645ea

Cleanup: Duplicate Labels and PRs from Issue-Poller Loop

Project

paper-dynasty-database on git.manticorum.com

What Was Cleaned Up

Duplicate PRs

Closed PRs #36, #37, #39 (created by the infinite loop). Left open:

  • PR #35 — real fix for issue #25
  • PR #38 — fix for issue #24

Duplicate Repo Labels

Deleted 8 duplicate labels:

  • 4 extra ai-working labels (IDs 49, 41, 56, 58)
  • 4 extra ai-reviewing labels (IDs 51, 59, 57, 50)

These were created because Haiku kept calling create_repo_label instead of checking for existing labels first.

Root Cause of Duplicates

The Haiku-based label creation did not search existing labels before creating. Each poll cycle created new label entries.

Prevention

The ensure_label() helper function in the rewritten poller searches existing labels first and only creates if missing:

ensure_label() {
  local name="$1"
  local color="$2"
  # Search existing labels, create only if not found
  existing=$(gitea_get "/repos/$OWNER/$REPO/labels" | jq -r ".[] | select(.name==\"$name\") | .id")
  if [ -z "$existing" ]; then
    gitea_post "/repos/$OWNER/$REPO/labels" "{\"name\":\"$name\",\"color\":\"$color\"}"
  fi
}