Return Copilot PR review code suggestions in get_review_comments#2630
Open
advancedresearcharray wants to merge 3 commits into
Open
Return Copilot PR review code suggestions in get_review_comments#2630advancedresearcharray wants to merge 3 commits into
advancedresearcharray wants to merge 3 commits into
Conversation
e76f1ae to
0846322
Compare
Author
|
Fixed build break from triple-backtick characters inside the All targeted tests pass locally:
|
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
0846322 to
094b3ff
Compare
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pull_request_read(get_review_comments) now fetches those partials per thread, parses the embeddedautomatedComment.suggestionpayload, and returns structuredsuggestionson each review commentsuggestionsarray (with asourcefield distinguishingautomatedvsbody)Closes #2235
Test plan
go test ./pkg/github/ -run 'TestDecode|TestParse|TestFetch|TestEnrich'go test ./pkg/github/ -run 'Test_GetPullRequestComments'pull_request_read(method="get_review_comments", ...)on a PR with Copilot suggestions and verifysuggestionsare populated