fix: add pagination to getAutomatedComments and increase thread limit

- getAutomatedComments: add --paginate flag to REST API call to fetch
  all review comments beyond the default 30-item first page
- getPendingComments: increase GraphQL reviewThreads limit from 100 to
  250 (GitHub's max for connections)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Prateek 2026-02-13 18:09:15 +05:30
parent e4a803edde
commit dc838eb63b
1 changed files with 3 additions and 2 deletions

View File

@ -319,7 +319,7 @@ function createGitHubSCM(): SCM {
`query=query($owner: String!, $name: String!, $number: Int!) {
repository(owner: $owner, name: $name) {
pullRequest(number: $number) {
reviewThreads(first: 100) {
reviewThreads(first: 250) {
nodes {
isResolved
comments(first: 1) {
@ -395,9 +395,10 @@ function createGitHubSCM(): SCM {
async getAutomatedComments(pr: PRInfo): Promise<AutomatedComment[]> {
try {
// Single API call gets all review comments (including bot review comments)
// Single paginated API call gets all review comments (including bot review comments)
const raw = await gh([
"api",
"--paginate",
`repos/${repoFlag(pr)}/pulls/${pr.number}/comments`,
]);