From 51ff6f7628ce219c679bcd9a3e90bb5996ae9195 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Tue, 3 Mar 2026 15:24:58 -0600 Subject: [PATCH] =?UTF-8?q?store:=20Fix:=20Issue-poller=20infinite=20loop?= =?UTF-8?q?=20=E2=80=94=20PRs=20returned=20as=20issues=20by=20gitea-mcp=20?= =?UTF-8?q?list=5Frepo=5Fissues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...op-prs-returned-as-issues-by-git-c1a50f.md | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 graph/fixes/fix-issue-poller-infinite-loop-prs-returned-as-issues-by-git-c1a50f.md diff --git a/graph/fixes/fix-issue-poller-infinite-loop-prs-returned-as-issues-by-git-c1a50f.md b/graph/fixes/fix-issue-poller-infinite-loop-prs-returned-as-issues-by-git-c1a50f.md new file mode 100644 index 00000000000..66b31f3c74f --- /dev/null +++ b/graph/fixes/fix-issue-poller-infinite-loop-prs-returned-as-issues-by-git-c1a50f.md @@ -0,0 +1,41 @@ +--- +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:24:58.158715+00:00" +--- + +# 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