Expand description
PR review polling — review_open_prs.
Extracted from engine/review.rs. Monitors tasks in InReview status,
checks for human review feedback, and re-dispatches agents when changes
are requested.
§Batching strategy
Instead of making 4–5 individual REST calls per in-review task, the loop is split into phases:
- Validate tasks and load stored data (no API calls).
- Resolve missing PR numbers concurrently via REST (rare after first tick).
- Handle tasks with no open PR (merged / reroute logic).
- Fetch all PR review data in one GraphQL query for all tasks at once.
- Build a collaborator cache from batch issue comments (unique users only).
- Process each task using the pre-fetched batch data.
With N in-review tasks the call count drops from ~5N REST calls to:
- M
get_pr_numberREST calls (M ≈ 0 after first tick per task) - 1 GraphQL batch call
- K
is_collaboratorREST calls (K = unique automated-review users ≪ N)