Skip to content

[bug] Review Agent fails on private GitHub repositories when fetching PR diff #1277

@hql287

Description

@hql287

Describe the bug

The Review Agent fails to review pull requests in a private GitHub repository because it cannot fetch the PR diff.

The webhook is received successfully, the review agent starts processing, and GitHub API access works, but the review fails when github-pr-parser attempts to fetch the .diff URL from GitHub.

To reproduce

Configure Review Agent according to documentation.
Install GitHub App on a private GitHub repository.
Open a PR.
Comment:
/review
Observe Review Agent logs.

Expected Behavior

The Review Agent should fetch the PR diff and generate a review.

Actual Behavior

The Review Agent fails while fetching the diff.

Logs:

[review-agent] Received a pull request event for #525
[github-pr-parser] Error fetching diff: Not Found
GET https://github.com/MyOrg/myrepo/pull/525.diff
404 Not Found

Sourcebot deployment information

Sourcebot: v5.0.1
Deployment: Docker Compose
GitHub App configured
Private GitHub repository
Review Agent enabled
DeepSeek configured as model provider
Self-hosted deployment

Additional information

The GitHub token can successfully access the PR through the GitHub API:

curl \
  -H "Authorization: token <TOKEN>" \
  https://api.github.com/repos/MyOrg/myrepo/pulls/525

This returns the PR JSON successfully.

The PR API returns:

{
  "diff_url": "https://github.com/MyOrg/myrepo/pull/525.diff"
}

However, fetching that URL directly returns 404:

curl -I -L \
  -H "Authorization: token <TOKEN>" \
  https://github.com/MyOrg/myrepo/pull/525.diff

Response:

HTTP/2 404

This appears to be the step where the Review Agent fails.

Question

Is the Review Agent expected to support private GitHub repositories?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions