Use case
When reviewing PR with more that 300 changed files agent is unable to perform review.
Issue location
Underlying github-service.ts (https://github.com/augmentcode/augment-agent/blob/main/src/services/github-service.ts#L132) uses the GitHub pulls.get endpoint with diff media type. GitHub's API returns a 422 too_large error for this endpoint when the diff exceeds 300 files. This is a hard GitHub API limitation — no amount of configuration can work around it.
The irony is that getPullRequestFiles already uses the paginated listFiles endpoint correctly. But the diff content is fetched via the non-paginated route.
quoting from logs
Error: [...] [Augment Agent] Sorry, the diff exceeded the maximum number of files (300). Consider using 'List pull requests files' API or locally cloning the repository instead.: {"resource":"PullRequest","field":"diff","code":"too_large"} - https://docs.github.com/rest/pulls/pulls#list-pull-requests-files | Data: {
"error": "undefined"
}
Possible fix
Generate the diff locally from the checked-out repo (which is already checked out in the action) using git diff
Use listFiles with the patch field per file instead of fetching the monolithic diff
Use case
When reviewing PR with more that 300 changed files agent is unable to perform review.
Issue location
Underlying
github-service.ts(https://github.com/augmentcode/augment-agent/blob/main/src/services/github-service.ts#L132) uses the GitHubpulls.getendpoint withdiffmedia type. GitHub's API returns a422 too_large errorfor this endpoint when the diff exceeds 300 files. This is a hard GitHub API limitation — no amount of configuration can work around it.The irony is that
getPullRequestFilesalready uses the paginatedlistFilesendpoint correctly. But the diff content is fetched via the non-paginated route.quoting from logs
Possible fix
Generate the diff locally from the checked-out repo (which is already checked out in the action) using git diff
Use
listFileswith thepatchfield per file instead of fetching the monolithic diff