Conversation
Replace per-branch GraphQL polling with single batch query that fetches all open PRs at once. This reduces N API calls per poll interval to 1. - Add get_all_open_prs() that fetches all open PRs in single GraphQL query - Return HashMap<branch_name, BranchPrInfo> for local matching - Update poll_pr_info_async to use batch query instead of per-branch calls - Add tests for GraphQL response parsing Co-Authored-By: piotrek & opus <noreply@anthropic.com>
Batch query only costs ~2 points, so 5s interval uses ~29% of rate limit. Much more responsive PR status updates. Co-Authored-By: piotrek & opus <noreply@anthropic.com>
The query was only fetching OPEN PRs, so merged/closed PRs would disappear from results and tasks would stay as "in progress". Now fetches all states (OPEN, MERGED, CLOSED) ordered by most recently updated. Co-Authored-By: piotrek & opus <noreply@anthropic.com>
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.
Summary
get_all_open_prs()function usinggh api graphqlwith batch queryheadRefNamefieldBackground
The app was exhausting GitHub GraphQL rate limits by making one API call per worktree branch every 30 seconds. With many worktrees, this quickly exhausted the 5000 points/hour limit.
Research findings:
Test plan