Skip to content

MCP server no longer allowing adding comments to pending reviews for fork PRs #1748

@daveernstingFR

Description

@daveernstingFR

Our organisation follows a forked development strategy and we have been making use of googles Gemini CLI github actions (https://github.com/google-github-actions/run-gemini-cli) for AI powered code review. We have noticed that since a little before the Christmas break the agent has been failing to successfully add line comments to pending reviews for PRs raised from forks using the MCP tool add_comment_to_pending_review.

We see this issue for PRs raised from forks but not for PRs raised from the same repo.

We use a github app token to authenticate the MCP actions, it has pull request write permissions for the target repo but not for forks.

This usage worked fine for us up until ~December including token/permissions settings and our forking model. Repo settings have not been changed. Therefore we think this is a defect either in Github MCP or with Github itself.

Affected version

This affects the hosted Github MCP server and the last several versions of the dockerised server.

Steps to reproduce the behavior

  1. Create a repo
  2. Create a fork of the repo
  3. Create a PR with a change from the fork to the upstream
  4. Attempt to have an AI agent configured with GitHub MCP submit a code review with line or file comments as part of the review
  5. Note that these tool calls are rejected

Expected vs actual behavior

It is expected that comments can be added to reviews on fork PRs, whereas this seems to only work for PRs coming from the same repo.

Logs

Actions logs when error:

Failed to add comment to pending review. Possible reasons:\n\t- The line number doesn't exist in the pull request diff\n\t- The file path is incorrect\n\t- The side (LEFT/RIGHT) is invalid for the specified line\n

Note that in this instance the path, line and side are correct and having an agent create the same comment on a PR from the base repo works without issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions