Skip to content

Return Copilot PR review code suggestions in get_review_comments#2630

Open
advancedresearcharray wants to merge 3 commits into
github:mainfrom
advancedresearcharray:fix/copilot-review-suggestions-2235
Open

Return Copilot PR review code suggestions in get_review_comments#2630
advancedresearcharray wants to merge 3 commits into
github:mainfrom
advancedresearcharray:fix/copilot-review-suggestions-2235

Conversation

@advancedresearcharray
Copy link
Copy Markdown

@advancedresearcharray advancedresearcharray commented Jun 6, 2026

Summary

  • Copilot-generated "Suggest" changesets are not returned by GitHub REST or GraphQL review comment APIs, but they are embedded in the authenticated review thread partial HTML used by the web UI
  • pull_request_read (get_review_comments) now fetches those partials per thread, parses the embedded automatedComment.suggestion payload, and returns structured suggestions on each review comment
  • Human-authored suggestion code blocks in comment bodies are also parsed into the same suggestions array (with a source field distinguishing automated vs body)

Closes #2235

Test plan

  • go test ./pkg/github/ -run 'TestDecode|TestParse|TestFetch|TestEnrich'
  • go test ./pkg/github/ -run 'Test_GetPullRequestComments'
  • Manual: call pull_request_read(method="get_review_comments", ...) on a PR with Copilot suggestions and verify suggestions are populated

@advancedresearcharray advancedresearcharray requested a review from a team as a code owner June 6, 2026 21:35
@advancedresearcharray advancedresearcharray force-pushed the fix/copilot-review-suggestions-2235 branch from e76f1ae to 0846322 Compare June 6, 2026 21:37
@advancedresearcharray
Copy link
Copy Markdown
Author

Fixed build break from triple-backtick characters inside the pull_request_read method description raw string (Go syntax error). Updated pull_request_read.snap toolsnap to match the expanded description.

All targeted tests pass locally:

  • go test ./pkg/github/ -run 'TestDecode|TestParse|TestFetch|TestEnrich'
  • go test ./pkg/github/ -run 'Test_GetPullRequestComments'

Copilot suggestion changesets are not exposed via REST/GraphQL, but they
are embedded in GitHub's review thread partial HTML. Decode thread node
IDs, fetch those partials with the authenticated client, and attach
structured suggestions alongside body-parsed suggestion code blocks.

Fixes description string syntax and updates pull_request_read toolsnap.

Closes github#2235
@advancedresearcharray advancedresearcharray force-pushed the fix/copilot-review-suggestions-2235 branch from 0846322 to 094b3ff Compare June 6, 2026 21:38
root and others added 2 commits June 6, 2026 23:21
Also add a fixture test with real Copilot diff data that includes
DELETION lines, verifying replacement suggestion text excludes removed
lines while preserving context and additions.

Co-authored-by: Cursor <cursoragent@cursor.com>
…comments

Verify pull_request_read wires GraphQL review threads to authenticated thread
partial fetches and returns structured suggestions on review comments.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copilot-generated PR review code suggestions ("Suggest" changesets) are not returned by pull_request_read or any API

1 participant