Feature: allow review comments on any file line, not just lines within the diff
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
調査の方向性
まず add_comment_to_pending_review と pull_request_review_write のエントリーポイントを読み、次に issue で説明されている保留中レビューのワークフローを、diff の外側にコメントを付けて再現します。submit_pending がそれらのコメントをどのように処理するか、また GraphQL の addPullRequestReviewThread mutation が path と line をどのように受け付けるかを追跡します。失敗が表面化するか、任意のファイル行へのコメントがインラインで保持され、既存のファイルレベルの回避策も引き続き利用できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the feature or problem you'd like to solve
When using add_comment_to_pending_review to leave a code review, the comment is silently dropped at submit time if the targeted line is outside the PR's diff hunks (e.g., unchanged context further up the file). The tool returns success on add_comment_to_pending_review, but pull_request_review_write { method: "submit_pending" } accepts the review without that comment ever appearing on the PR.
This means agents reviewing PRs cannot leave inline comments on file context that is relevant to a change but happens to sit outside the modified lines — for example, stale JSDoc on an exported interface that should be updated to reflect a new feature added several lines below.
In the GitHub web UI, a human reviewer can expand context and click any line in any file to add a comment. Agents using this MCP server cannot match that capability.
Proposed solution
Two parts:
-
Surface the failure. When a comment is dropped because the targeted line is outside the diff, return an error from
add_comment_to_pending_review(or surface it on submit) so the agent can fall back tosubjectType: "FILE"or a top-level comment. Today the tool reports success and the rejection happens silently inside GitHub's submit step. -
Support arbitrary file lines. Use the GraphQL
addPullRequestReviewThreadmutation (which acceptspath+linewithout requiring a diff position) when the requested line is outside the unified diff. This would give agent reviewers the same expressive power as human reviewers in the UI.
Example prompts or workflows (for tools/toolsets only)
- "Review this PR — flag any stale JSDoc/comments on exported APIs whose contract changed." Today the agent can correctly identify stale documentation but cannot leave the inline comment if the JSDoc itself isn't in the diff.
- "Suggest renames for the helper functions used by the new code." If the helpers themselves are unchanged, the agent can't comment on them inline.
- "Note any security-relevant invariants the changes rely on." Often these are documented elsewhere in the file, outside the diff.
Additional context
Repro:
- Open any PR with a small, localized diff.
- Use
pull_request_review_write { method: "create" }to start a pending review. - Use
add_comment_to_pending_reviewtargeting an unchanged line ≥30 lines from the diff. Tool returns success. - Use
pull_request_review_write { method: "submit_pending" }. Review submits without the comment. - Verify on the PR — the comment is missing.
Workaround today: use subjectType: "FILE" for file-level comments, or post a top-level issue comment with a permalink. Both lose the inline-thread experience.
Related but distinct: #1748 (fork-PR auth scope) — same symptom (comment doesn't post) but a different root cause.
- 主要言語
- 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
-
textual definition
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
geneontology/go-ontology#32653 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
-
needs design
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
Priority/High ready-for-agent Severity/Major Type/Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100