Skip to content

Review failure for PR with more than 300 changed files #16

@jbesta

Description

@jbesta

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions