Copilot-generated PR review code suggestions ("Suggest" changesets) are not returned by pull_request_read or any API
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 38/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- github, go
調査の方向性
pull_request_read get_review_comments エントリーポイントから開始し、zai-org/GLM-OCR#131 を使ってデータ欠落のケースを再現します。返されたレビューコメントを、Web UI に表示される Copilot の提案およびここで説明されている REST/GraphQL の結果と比較します。利用可能な GitHub API サーフェスを前提として、提案の changeset が MCP レスポンスを通じて公開されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the feature or problem you'd like to solve
When GitHub Copilot reviews a pull request, it generates two distinct types of content per review comment:
- Prose commentary — a text description of the issue found (e.g., "Consider adding pydantic validation...")
- Suggested code changesets — concrete, committable code diffs rendered with a green "Commit suggestion" / "Add to batch" button in the GitHub web UI
Currently, the pull_request_read tool (method: get_review_comments) and the underlying GitHub REST + GraphQL APIs only return the prose commentary in the comment body field. The suggested code changesets that Copilot generates — the ones visible in the GitHub web UI with the "Commit suggestion" button — are completely absent from all API responses.
This means MCP-connected AI agents cannot:
- Read Copilot's actual code suggestions to evaluate their correctness
- Programmatically accept, reject, or modify Copilot's suggested changes
- Build automated workflows that triage Copilot review suggestions
- Provide informed assessments of whether a Copilot suggestion should be committed
Exhaustive investigation proving the data is missing
I performed a thorough investigation across every available API surface to confirm this is not a client-side issue. The test PR used: https://github.com/zai-org/GLM-OCR/pull/131 — Copilot generated 9 review comments, each with a visible "Suggest" code changeset in the GitHub web UI.
1. GitHub MCP Server — pull_request_read with get_review_comments
Using the official github/github-mcp-server (Docker, ghcr.io/github/github-mcp-server), I called:
pull_request_read(method="get_review_comments", owner="zai-org", repo="GLM-OCR", pullNumber=131)
Result: All 9 review threads returned with prose-only body fields. Zero suggestion blocks.
2. REST API — GET /repos/{owner}/{repo}/pulls/{pull_number}/comments
gh api repos/zai-org/GLM-OCR/pulls/131/comments --paginate --jq ".[].body"
Result: All 9 comment bodies are plain prose text. No ```suggestion ``` markdown blocks present.
3. GraphQL API — body and bodyHTML fields on PullRequestReviewComment
{
repository(owner: "zai-org", name: "GLM-OCR") {
pullRequest(number: 131) {
reviewThreads(first: 15) {
nodes {
comments(first: 5) {
nodes {
body
bodyHTML
author { login }
}
}
}
}
}
}
}
Result: Both body and bodyHTML contain only prose. Checked every Copilot comment:
{"has_suggestion_in_body": false, "has_suggestion_in_html": false}
// ... repeated for all 9 comments
4. GraphQL — suggestedChanges field
Attempted to query suggestedChanges on PullRequestReviewComment:
suggestedChanges(first: 5) {
nodes { suggestion, originalStartLine, originalEndLine }
}
Result: Field 'suggestedChanges' doesn't exist on type 'PullRequestReviewComment'
5. Community MCP server (@modelcontextprotocol/server-github)
Also tested with the community npm-based server — identical results: prose only, no suggestion code blocks.
What the GitHub web UI shows vs what the API returns
In the GitHub web UI, each Copilot review comment has two sections:
- The prose text (e.g., "This test module is collected by default...")
- A "Suggest" panel with a green-highlighted code diff and "Commit suggestion" / "Add to batch" buttons
Through any API, only the prose text is returned. The suggested code changeset is completely absent. It appears these suggestion diffs are either:
- Rendered client-side by GitHub's UI JavaScript and never persisted as part of the comment body
- Stored in a proprietary Copilot-internal data structure not exposed through any public API
- Attached to the comment via a mechanism that has no corresponding REST/GraphQL field
This is fundamentally different from human-written suggestions, which use ```suggestion ``` markdown syntax embedded directly in the comment body and ARE returned by all APIs.
Proposed solution
Expose Copilot's generated code suggestions through the API so that MCP-connected agents can read them. This could take several forms:
Option A (Preferred): Include suggestion blocks in the comment body
Store Copilot's suggestions as standard ```suggestion ``` markdown in the comment body, identical to how human-written suggestions work. This would require zero API changes — the existing body field would just contain the full content.
Option B: Add a suggestedChanges field to PullRequestReviewComment in GraphQL
type PullRequestReviewComment {
# ... existing fields ...
suggestedChanges: SuggestedChangeConnection
}
type SuggestedChange {
suggestion: String! # The suggested replacement code
originalStartLine: Int! # Start line in the diff
originalEndLine: Int! # End line in the diff
path: String! # File path
}
Then the MCP server's pull_request_read (method: get_review_comments) could include these in its response.
Option C: Add a REST API field
Add a suggested_changes array to the review comment REST response:
{
"id": 2951701990,
"body": "This test module is collected by default...",
"suggested_changes": [
{
"original_start_line": 1,
"original_end_line": 15,
"suggestion": "import pytest\n\npytest.importorskip(\n \"torch\",\n reason=\"...\",\n)\n..."
}
]
}
Example prompts or workflows (for tools/toolsets only)
1. Evaluate Copilot suggestions before committing
"Fetch all of Copilot's review comments on PR #131 including their suggested code changes, and tell me which ones are safe to commit"
Agent reads review threads with suggestion diffs, analyzes each suggestion against the codebase context, and provides a recommendation per suggestion.
2. Batch-commit safe suggestions
"For each Copilot suggestion on this PR, if it's a pure import guard or test marker change, commit it automatically"
Agent reads suggestions, filters by category, and commits the safe ones via add_comment_to_pending_review or the suggestions API.
3. Generate counter-suggestions
"Read Copilot's suggested changes and propose alternative implementations where you disagree"
Agent reads the actual code diffs Copilot proposed, compares with its own analysis, and replies with alternative ```suggestion ``` blocks.
4. Audit Copilot review quality
"Compare what Copilot suggested vs what the codebase actually needs and rate each suggestion"
Agent needs both the prose rationale AND the concrete code change to evaluate correctness. Currently only the prose is available.
Additional context
Scope of the problem:
This affects ALL Copilot-generated PR reviews. Every time Copilot reviews a PR and generates "Suggest" changesets (which is the majority of Copilot reviews), those changesets are invisible to any API consumer. Only the prose description is accessible.
Note: This issue is upstream of the MCP server — it's fundamentally a GitHub platform/API limitation. The MCP server correctly returns everything the GitHub API provides. However, filing here because:
- The MCP server is the primary interface AI agents use to interact with GitHub
- The MCP server team has direct access to internal GitHub APIs and could surface this data even if the public REST/GraphQL APIs don't expose it yet
- This is a critical gap for the "AI agents reviewing code" workflow that the MCP server is designed to enable
Affected version:
github-mcp-server latest (ghcr.io/github/github-mcp-server:latest)
Docker image digest: sha256:a9dd39eec67f09ded51631c79641dd72acb4945c6391df47824fa2d508b5431b
Environment:
- Docker 28.5.1 on Windows 11
- GitHub token: OAuth (
gho_***) with scopesgist,read:org,repo,workflow - Also tested with community
@modelcontextprotocol/server-githubvia npx
Reference PR used for testing: https://github.com/zai-org/GLM-OCR/pull/131 (9 Copilot review comments, all with "Suggest" changesets visible in web UI, none returned via API)
- 主要言語
- Go
- スター
- 33.1k
- フォーク
- 5k
- 平均マージ
- 2日 1時間
- マージ済み PR(30日)
- 25
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/github-mcp-server のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
github/github-mcp-server#3235 ·
-
enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
github/github-mcp-server#3042 · コメント 2 件 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
github/github-mcp-server#3032 · リアクション 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
github/github-mcp-server#2803 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
github/github-mcp-server#2740 ·
github/github-mcp-server の issue をすべて見る
似ている issue
-
feature-request helm
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
gravitational/teleport#69785 ·
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
crossplane/crossplane#7859 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100