fix: paginate orchestrator issue dispatch to find eligible issues (#928)#930
Merged
fix: paginate orchestrator issue dispatch to find eligible issues (#928)#930
Conversation
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>
There was a problem hiding this comment.
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 throughawissues until an eligible one is found or pages are exhausted. - Increases the per-page fetch size from
first: 20tofirst: 100(GraphQL max) to reduce the number of API calls. - Extends the jq label exclusion filter to also exclude
backlog.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
whileloop with cursor-based paginationfirst: 100(GraphQL max) per pagebacklogto the label exclusion filterReview
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