[Feat] Restore line-anchored inline PR review comments on all providers - #1129
Merged
Merged
Conversation
The review skill lost the ability to create new line-anchored inline comments when it moved to the provider-neutral manage_source_control surface; findings could only reply to existing threads or be carried in the summary comment as file:line references. This adds a create_pull_request_review_comment action (one finding per call) implemented for GitHub, GitLab, Gitea, Bitbucket, and Azure DevOps, with anchor rejections surfaced as retryable 422 errors and the review-code skill updated to post inline comments with provider-aware suggestion blocks and a retry-once-then-summary-carry recovery.
Contributor
|
No code issues found. See task
Reviewed e4b8e2f |
Review feedback: positions now carry the file's real old_path/new_path resolved from the merge request diff list (renamed files anchored correctly, same-path fallback when the listing is unavailable), and the thread reader falls back to old_path/old_line so deleted-line threads stay matchable in sync reviews.
Review feedback: the five-page cap could miss a renamed file on merge requests with more than 500 changed files. Follow pagination until the listing ends, with a backstop beyond GitLab's own ~3,000-file diff cap so it only guards against runaway loops.
…s hit Review feedback: rather than an unbounded pagination loop against arbitrary self-hosted GitLab servers, keep the runaway backstop but report the same-path fallback explicitly through the write result warnings (and in the anchor-rejection message) when the scan ends before the diff listing does.
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
When the review workflow moved to the provider-neutral
manage_source_controlsurface, it lost the ability to create new line-anchored inline comments: findings could only reply to existing review threads or be carried in the canonical summary comment asfile.ts:42references.This restores inline commenting by adding a
create_pull_request_review_commentaction tomanage_source_control, implemented for all five providers, and updating the review-code skill to use it.Design
diff_refs(GitLab) at call time; callers pass onlypath,line,side, and an optionalstartLine/startSiderange.applied:falsestays reserved for genuine provider capability gaps, and this action never returns it.threadIdmatches the read surface per provider so the agent can immediately reply to or resolve the thread it just created.Provider mappings
pulls.createReviewCommentwith call-time head SHAPOST .../discussionswith apositionbuilt from MRdiff_refsPOST .../pulls/{n}/reviewswith one positioned commentPOST .../commentswithinline: {path, to/from}POSTwiththreadContextfile rangeSkill changes
All four review appendices in
review-code/SKILL.mdnow:suggestionfences on GitHub/Gitea,suggestion:-0+0on GitLab, plain code blocks on Bitbucket/ADO),file.ts:42reference (the pre-migration recovery contract),The
finding_without_thread_anchorerror scenario is replaced byinline_comment_anchor_rejected.Review feedback addressed
old_path/new_pathresolved from the merge request diff list, so anchors on renamed files work (same-path fallback when the diff listing is unavailable).old_path/old_linefor old-side diff notes, so deleted-line threads stay matchable in sync reviews instead of being duplicated.Known limitations
Testing
diff_refshandling, renamed-file path resolution, and old-side thread anchoring.pnpm lint,pnpm check-types,pnpm knipall pass.github_pr_reviewtask against a seeded-bug PR posted four correctly line-anchored inline review comments, catching all three seeded bugs plus one unseeded real issue.