fix(review): list applyable suggestion ranges in overview receipts - #974
fix(review): list applyable suggestion ranges in overview receipts#974seonghobae wants to merge 18 commits into
Conversation
When GitHub refuses inline review comments, the PR-level fallback now lists each sanitized current-head finding location instead of a generic sentence. Suggested diffs stay out of the body.
Rebuild the fallback from gh api stderr after a refused attach so the OpenCode overview keeps each trusted path:line next to the GitHub 422 phrase instead of a location-only list.
A single invalid path:line 422s the whole comments array. After that failure, split the payload and retry each comment so surviving hunks still attach; remaining failures keep the overview receipts.
The publisher moved that phrase out of the workflow YAML, so the exact-head path-policy harness failed looking in the old file.
When some one-at-a-time inline comments attach and others 422, the overview must list only the refused locations so attached hunks are not reported as failed.
Mixed one-at-a-time retries can fail for different reasons. Record path:line plus that comment's gh api error so the overview does not reuse one shared sentence for every refused hunk.
Unbounded one-at-a-time retry after a batch 422 can thrash GitHub, and mixed receipts listed only refused locations. Cap retries at 20, persist attached path:line beside refused ones, and record leftovers the cap left untried so the overview shows every outcome.
GitHub 422s review comments that sit outside every current-head @@ hunk. Filter the payload against git diff --unified=3 first, post only the on-hunk comments, and persist skipped path:line as overview receipts.
Authors could not one-click apply OpenCode inline repairs because the payload only posted ```diff fences. Convert + lines from those diffs into ```suggestion blocks on surviving RIGHT-side hunk comments.
A surviving suggested_diff that removes more than one current-head line still posted as a single-line comment, so Apply suggestion only replaced the first line. Set start_line, line, and start_side when the full span sits on the same hunk; leave off-hunk spans single-line to avoid 422.
Authors could see refused and skipped path:line after a 422, but not which surviving hunks shipped as one-click GitHub suggestions. Persist path:line or path:start-end for comments that carry a suggestion fence.
|
Warning Review limit reached
Next review available in: 93 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (10)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@cwl-noema-review Please review the current head. Persist applyable GitHub suggestion ranges (path:line or path:start-end) in the overview receipts so authors can see which surviving hunks shipped as one-click applies. |
GitHub one-click apply is a RIGHT-side hunk action. A leftover suggestion fence on a LEFT comment is not advertised as applyable. A 422 substring in a SHA or issue number no longer starts retry.
|
@cwl-noema-review Please review this exact current head ( |
A multi-line GitHub suggestion that already has start_line/start_side must keep that range when the batch 422 path retries one comment at a time. Dropping the range posts a single comment on the last line.
|
@cwl-noema-review |
A RIGHT-side range that still starts on LEFT is leftover, not a one-click GitHub apply. Keep those fences off the applyable list.
|
@cwl-noema-review Please review this exact current head ( |
|
@cwl-noema-review |
Applyable path:start-end rows live in <!-- opencode-review-overview -->. Strip leftover comment delimiters and HTML metacharacters so a path cannot close that comment (CWE-116).
|
@cwl-noema-review Please review this exact current head. Applyable |
Classify applyable GitHub suggestions by a closed ```suggestion fence so leftover prose that mentions the token is not advertised as a one-click apply (CWE-1288).
|
@cwl-noema-review exact current head |
Materialize a base Python lock only when every package line is an exact SHA-256 pin or a two-token relative -r/--requirement include of a candidate lock path. A lone --require-hashes directive, ./dotted paths, and -r other-hashes.txt no longer enter the trusted build context.
|
@cwl-noema-review exact current head |
Reject leftover 422-fallback paths that contain -->, <!--, or a suggestion fence so a leftover cannot close the overview HTML comment or reopen an applyable GitHub suggestion block.
|
@cwl-noema-review exact current head |
Summary
Overview receipts listed attached, refused, deferred, and skipped
path:line, but not which surviving hunks shipped as one-click GitHub suggestions.path:lineorpath:start-end.GitHub can apply these suggested replacements:next to the other receipts.#954/#968–#973 remain MERGEABLE with auto-merge; they are blocked by the two-approval ruleset, not a current-head code fail.
Test plan
pytest tests/test_opencode_inline_comment_fallback.py tests/test_opencode_agent_contract.py— 67 passedcoverage run -m pytest tests --ignore=tests/test_strix_quick_gate.sh— 1004 passed, 100% statements/branches, interrogate 100%