--- id: c1a50fb8-9084-439d-a156-872bedb9013b type: fix title: "Fix: Issue-poller infinite loop — PRs returned as issues by gitea-mcp list_repo_issues" tags: [issue-poller, gitea, gitea-mcp, paper-dynasty-database, automation, bug, claude-scheduled, infinite-loop] importance: 0.9 confidence: 0.8 created: "2026-03-03T21:24:58.158715+00:00" updated: "2026-03-03T21:25:56.958675+00:00" relations: - target: b27fb831-811e-4103-b5f1-3c36d5b1ad20 type: RELATED_TO direction: outgoing strength: 0.91 edge_id: bbaaa41b-f240-4965-8c7a-60a52fd16ad0 - target: b27fb831 type: RELATED_TO direction: outgoing strength: 0.89 edge_id: f54dc1cf-3e7f-4dd0-90ea-6c96aed9c444 - target: 4321bee8-105e-4fc8-b645-964d1234c966 type: RELATED_TO direction: outgoing strength: 0.88 edge_id: 6c40dc03-9bd1-4e73-9c1c-a66a3a9248b3 - target: 78841477-74c0-430a-8a69-9df80602bd6f type: CAUSES direction: outgoing strength: 0.95 edge_id: 91b7efa3-57e4-44e9-8ea7-a5e64f0329f1 - target: 436e133f-2c31-488a-9810-fb6ca5b45250 type: CAUSES direction: outgoing strength: 0.9 edge_id: b6ee1850-88c1-4860-b757-b07e1d7fb855 - target: 91e8d0c6-74c0-472f-b123-d30123bfd009 type: CAUSES direction: outgoing strength: 0.95 edge_id: c250081e-5695-4789-b483-395a3f8645ea - target: c4b2f42d-b443-447f-8a05-bba099e06036 type: RELATED_TO direction: outgoing strength: 0.85 edge_id: b64edf24-dae5-4ce0-b94a-6fda0a60ef30 --- # Issue-Poller Infinite Loop Bug ## Project claude-scheduled / issue-poller automation ## Problem The issue-poller had an infinite loop where PRs created by the worker were picked up as new "issues" on subsequent poll cycles, causing a chain of recursive PR creation: Issue #25 → PR #35 → PR #36 → PR #37 → PR #39 Each new PR was "fixing" the previous one as if it were an open issue. ## Root Cause The `mcp__gitea-mcp__list_repo_issues` MCP tool does NOT expose a `type` parameter. The underlying Gitea REST API supports `?type=issues` to filter server-side, but the MCP wrapper silently ignores it. As a result, PRs and issues are returned together, and the poller treated every open PR as an unhandled issue. ## Fix Replaced the Haiku+MCP call for listing issues with a direct `curl` call to the Gitea REST API: ```bash curl -s -H "Authorization: token $GITEA_TOKEN" \ "https://git.manticorum.com/api/v1/repos/{owner}/{repo}/issues?state=open&type=issues" ``` The `?type=issues` parameter filters PRs server-side, returning only true issues. ## Alternative (MCP path) If forced to use MCP, filter client-side by checking `item["pull_request"]` — it is null for real issues and a dict for PRs. ## Affected Repo paper-dynasty-database on git.manticorum.com