fix(review): retry inline comments one at a time after batch 422 - #966
fix(review): retry inline comments one at a time after batch 422#966seonghobae wants to merge 12 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.
|
Warning Review limit reached
Next review available in: 78 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 (12)
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 this current head. After a batch 422, inline comments must retry one at a time so surviving hunks still attach. |
The publisher moved that phrase out of the workflow YAML, so the exact-head path-policy harness failed looking in the old file.
|
@cwl-noema-review please review this current head (154a33d). Path-policy now pins the 422 sentence in the Python helper. |
CWE-1288: a commit SHA or issue number containing 422 must not start the one-at-a-time inline retry. Classify only HTTP 422 lines, Unprocessable Entity, or JSON error phrases.
Keep surviving hunks attachable after a batch 422, but escape backticks and HTML metacharacters in GitHub error phrases before they enter the overview body.
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.
A batch 422 now retries at most 20 comments. Locations past that cap are recorded as deferred path:line rows instead of opening unbounded gh api writes.
One-at-a-time retries after a batch 422 keep applyable suggestion fences, but leftover ```diff/```patch blocks still 422 the write. Strip those leftover fences so remaining prose can attach.
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 |
Leftover path:line receipts live in the overview HTML comment. Strip HTML metacharacters and suggestion fences so a leftover cannot close the comment or reopen an applyable GitHub suggestion block.
|
@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.
Summary
A batch
comments: []review returns HTTP 422 when any one path:line cannot attach, so every other hunk was dropped. After that 422 the publisher now:REQUEST_CHANGESplus the body for the first success, thenCOMMENTIncludes the #964 receipt work so this branch can land independently.
Test plan
pytest tests/test_opencode_inline_comment_fallback.py tests/test_opencode_agent_contract.py— 50 passed, 100% on the helperpytest tests— 987 passed, 100% statements/branches, interrogate 100%