Skip to content

fix: paginate orchestrator issue dispatch to find eligible issues (#928)#930

Merged
microsasa merged 1 commit intomainfrom
fix/928-orchestrator-pagination
Apr 16, 2026
Merged

fix: paginate orchestrator issue dispatch to find eligible issues (#928)#930
microsasa merged 1 commit intomainfrom
fix/928-orchestrator-pagination

Conversation

@microsasa
Copy link
Copy Markdown
Owner

Problem

The orchestrator's dispatch step queried only the first 20 aw-labeled issues (first: 20, oldest first, no pagination). It then post-filtered in jq to exclude already-handled labels. When all 20 slots were filled with old handled issues, the filter returned null — "No eligible issues to dispatch" — even though newer undispatched issues existed beyond the window.

The pipeline was idle for ~4 days because of this.

Fix

  • Wraps the GraphQL query in a paginated while loop with cursor-based pagination
  • Uses first: 100 (GraphQL max) per page
  • Stops as soon as an eligible issue is found or all pages are exhausted
  • Adds backlog to the label exclusion filter

Review

Three-model review (Opus 4.6, Codex, Sonnet 4.6) — all clean, no issues. Pagination logic, cursor interpolation, error handling, and edge cases all verified.

Closes #928

The dispatch query used `first: 20` with no pagination, causing newer
undispatched issues to be invisible when 20+ old handled issues filled
the window. Now paginates through all pages (100 per page) until an
eligible issue is found.

Also added `backlog` to the label exclusion filter.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 15, 2026 14:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the orchestrator “Dispatch implementer for unworked issues” step so it can reliably find an eligible aw-labeled issue even when the first page contains only already-handled/excluded issues, preventing the pipeline from idling incorrectly.

Changes:

  • Adds cursor-based pagination (pageInfo.hasNextPage/endCursor) to walk through aw issues until an eligible one is found or pages are exhausted.
  • Increases the per-page fetch size from first: 20 to first: 100 (GraphQL max) to reduce the number of API calls.
  • Extends the jq label exclusion filter to also exclude backlog.

@microsasa microsasa merged commit a6beb89 into main Apr 16, 2026
8 checks passed
@microsasa microsasa deleted the fix/928-orchestrator-pagination branch April 16, 2026 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: pipeline-orchestrator dispatch query limited to 20 issues — newer issues invisible

2 participants