Proposal: improve pr-review-pool-supervisor — add pagination for PR listing #8030

Open
opened 2026-04-13 00:44:00 +00:00 by HAL9000 · 0 comments
Owner

Agent Improvement Proposal

Pattern Detected

Type: workflow_fix
Affected Agent: pr-review-pool-supervisor
Category: Task-type failure — agent systematically misses work due to missing pagination
Evidence: Direct code inspection of .opencode/agents/pr-review-pool-supervisor.md, line 299, combined with repository state showing 257+ open PRs (documented in PR #8015 timeline update body).

Problem Description

The pr-review-pool-supervisor fetches open PRs with a single non-paginated call:

# Line 299 of pr-review-pool-supervisor.md
all_open_prs = forgejo_list_repo_pull_requests(owner, repo, state="open")

The Forgejo API returns at most 50 items per page by default. With 257 open PRs currently in the repository (as of Day 102, 2026-04-12), the review supervisor is only seeing approximately 50 out of 257 PRs — roughly 19% of the total PR backlog.

This means ~207 PRs are never reviewed by the review pool supervisor. These PRs accumulate without code review, blocking the merge pipeline.

Contrast with Fixed Implementation

The implementation-pool-supervisor had the same bug and it was explicitly fixed. The fix is documented in RULE 2 (lines 73-90) and RULE 3 (lines 93-99) of that agent's definition, with a full pagination loop:

# From implementation-pool-supervisor.md — the CORRECT pattern
page = 1
all_prs = []
while True:
    page_result = forgejo_list_repo_pull_requests(owner, repo, state="open", page=page, limit=50)
    if not page_result or len(page_result) == 0:
        break
    all_prs.extend(page_result)
    if len(page_result) < 50:  # Last page
        break
    page += 1

The implementation supervisor even has a documented failure mode from 2026-04-12 where it missed 241 PRs due to this exact issue. The review supervisor has the same bug but it was never fixed there.

Proposed Change

Replace the single non-paginated call in pr-review-pool-supervisor.md (line 299) with a pagination loop identical to the one in implementation-pool-supervisor.md:

# BEFORE (broken):
all_open_prs = forgejo_list_repo_pull_requests(owner, repo, state="open")

# AFTER (correct):
all_open_prs = []
page = 1
while True:
    page_result = forgejo_list_repo_pull_requests(owner, repo, state="open", page=page, limit=50)
    if not page_result or len(page_result) == 0:
        break
    all_open_prs.extend(page_result)
    print(f"[PR-SCAN] Fetched page {page}: {len(page_result)} PRs (total: {len(all_open_prs)})")
    if len(page_result) < 50:
        break
    page += 1
print(f"[PR-SCAN] Found {len(all_open_prs)} total open PRs to evaluate for review")

Also add a note in the agent's header (similar to RULE 2 in implementation-pool-supervisor) warning against using non-paginated calls.

Expected Impact

  • Review supervisor will see all 257 PRs instead of only ~50
  • PRs that have been waiting for review without being noticed will finally get reviewed
  • Review throughput should increase significantly, unblocking the merge pipeline
  • Reduces the backlog of approved-but-not-reviewed PRs

Risk Assessment

Risk level: Very Low

  • Pagination is a well-understood pattern already proven in implementation-pool-supervisor
  • The change is purely additive — it fetches more data, not less
  • The only downside is slightly more API calls per cycle (6 pages instead of 1), which is negligible
  • No behavioral changes beyond seeing more PRs

This is a proposal from the agent evolver. A human must approve this issue before the change will be implemented. To approve: remove the needs feedback label, add State/Verified, or comment with approval.


Automated by CleverAgents Bot
Supervisor: Agent Evolution | Agent: agent-evolution-pool-supervisor

## Agent Improvement Proposal ### Pattern Detected **Type**: workflow_fix **Affected Agent**: `pr-review-pool-supervisor` **Category**: Task-type failure — agent systematically misses work due to missing pagination **Evidence**: Direct code inspection of `.opencode/agents/pr-review-pool-supervisor.md`, line 299, combined with repository state showing 257+ open PRs (documented in PR #8015 timeline update body). ### Problem Description The `pr-review-pool-supervisor` fetches open PRs with a single non-paginated call: ```python # Line 299 of pr-review-pool-supervisor.md all_open_prs = forgejo_list_repo_pull_requests(owner, repo, state="open") ``` The Forgejo API returns at most **50 items per page** by default. With **257 open PRs** currently in the repository (as of Day 102, 2026-04-12), the review supervisor is only seeing approximately **50 out of 257 PRs** — roughly **19% of the total PR backlog**. This means ~207 PRs are **never reviewed** by the review pool supervisor. These PRs accumulate without code review, blocking the merge pipeline. ### Contrast with Fixed Implementation The `implementation-pool-supervisor` had the same bug and it was explicitly fixed. The fix is documented in RULE 2 (lines 73-90) and RULE 3 (lines 93-99) of that agent's definition, with a full pagination loop: ```python # From implementation-pool-supervisor.md — the CORRECT pattern page = 1 all_prs = [] while True: page_result = forgejo_list_repo_pull_requests(owner, repo, state="open", page=page, limit=50) if not page_result or len(page_result) == 0: break all_prs.extend(page_result) if len(page_result) < 50: # Last page break page += 1 ``` The implementation supervisor even has a documented failure mode from 2026-04-12 where it missed 241 PRs due to this exact issue. The review supervisor has the same bug but it was never fixed there. ### Proposed Change Replace the single non-paginated call in `pr-review-pool-supervisor.md` (line 299) with a pagination loop identical to the one in `implementation-pool-supervisor.md`: ```python # BEFORE (broken): all_open_prs = forgejo_list_repo_pull_requests(owner, repo, state="open") # AFTER (correct): all_open_prs = [] page = 1 while True: page_result = forgejo_list_repo_pull_requests(owner, repo, state="open", page=page, limit=50) if not page_result or len(page_result) == 0: break all_open_prs.extend(page_result) print(f"[PR-SCAN] Fetched page {page}: {len(page_result)} PRs (total: {len(all_open_prs)})") if len(page_result) < 50: break page += 1 print(f"[PR-SCAN] Found {len(all_open_prs)} total open PRs to evaluate for review") ``` Also add a note in the agent's header (similar to RULE 2 in implementation-pool-supervisor) warning against using non-paginated calls. ### Expected Impact - Review supervisor will see **all 257 PRs** instead of only ~50 - PRs that have been waiting for review without being noticed will finally get reviewed - Review throughput should increase significantly, unblocking the merge pipeline - Reduces the backlog of approved-but-not-reviewed PRs ### Risk Assessment **Risk level: Very Low** - Pagination is a well-understood pattern already proven in `implementation-pool-supervisor` - The change is purely additive — it fetches more data, not less - The only downside is slightly more API calls per cycle (6 pages instead of 1), which is negligible - No behavioral changes beyond seeing more PRs --- *This is a proposal from the agent evolver. A human must approve this issue before the change will be implemented. To approve: remove the `needs feedback` label, add `State/Verified`, or comment with approval.* --- **Automated by CleverAgents Bot** Supervisor: Agent Evolution | Agent: agent-evolution-pool-supervisor
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#8030
No description provided.