Skip to content

fix(pr-review-toolkit): recover truncated file pages - #57

Merged
cblecker merged 2 commits into
mainfrom
fix/pr-review-toolkit-file-page-recovery
Jun 24, 2026
Merged

fix(pr-review-toolkit): recover truncated file pages#57
cblecker merged 2 commits into
mainfrom
fix/pr-review-toolkit-file-page-recovery

Conversation

@cblecker

@cblecker cblecker commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • keep changed-file manifest collection complete-first for large PRs
  • collect file metadata even when large patch bodies are truncated
  • recover only incomplete file-page ranges with perPage=1 reads and preserve recovered page metadata
  • bump pr-review-toolkit to 1.6.2

Validation

  • rtk node --check pr-review-toolkit/skills/review-pr/review-pr.js
  • rtk claude plugin validate ./pr-review-toolkit
  • rtk claude plugin validate .
  • rtk uvx skillsaw --strict
  • rtk git diff --check

Summary by CodeRabbit

  • New Features

    • Improved file collection reliability when reviewing pull requests, with automatic retry of missing file entries.
  • Bug Fixes

    • Better handles truncated or partially available patch data, reducing failed or incomplete review runs.
    • Consolidates missing-file errors into a single clearer failure message.
    • Updated the plugin version to the latest patch release.

Collect changed-file metadata when patch bodies are truncated, then recover only incomplete page ranges with single-file reads. This keeps large PR manifests complete without retrying the full manifest at smaller page sizes.

Assisted-by: Codex:gpt-5
Copilot AI review requested due to automatic review settings June 24, 2026 19:28
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@cblecker, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 50 minutes and 22 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 credits.

🚦 How do rate 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 see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 37a716d4-056a-4ec5-b232-f2224ba3e6a5

📥 Commits

Reviewing files that changed from the base of the PR and between 5de5296 and f4bcc1b.

📒 Files selected for processing (1)
  • pr-review-toolkit/skills/review-pr/review-pr.js
📝 Walkthrough

Walkthrough

The plugin manifest version changes to 1.6.2. The PR review skill now reads file manifests with fixed-size pages, detects incomplete pages, retries missing single-file slots, and returns completion metadata after recovery.

Changes

Manifest recovery and version metadata

Layer / File(s) Summary
Version bump and retry cap
pr-review-toolkit/.claude-plugin/plugin.json, pr-review-toolkit/skills/review-pr/review-pr.js
The plugin manifest version updates to 1.6.2, and single-page recovery retries are capped at 2.
Page helpers and prompt handling
pr-review-toolkit/skills/review-pr/review-pr.js
mergeFilePages uses each page result's perPage, helper functions compute and summarize page count issues, and the collect-page prompt returns metadata for truncated or unavailable patch content.
Fixed-page manifest recovery
pr-review-toolkit/skills/review-pr/review-pr.js
collectFilePages records per-page sizes and retry slots, and collectCompleteFileManifest fetches fixed-size pages, retries missing single-file pages, and returns completion metadata.

Sequence Diagram(s)

sequenceDiagram
  participant collectCompleteFileManifest
  participant collectFilePages
  participant collectFilePage
  participant filePageResultIssues
  participant missingSingleFilePages

  collectCompleteFileManifest->>collectFilePages: fetch pages with FILE_PAGE_SIZE
  collectFilePages->>collectFilePage: collect each page in parallel
  collectCompleteFileManifest->>filePageResultIssues: compare expected vs actual file counts
  filePageResultIssues-->>collectCompleteFileManifest: incomplete page slots
  collectCompleteFileManifest->>collectFilePages: retry missing slots with perPage=1
  collectCompleteFileManifest->>missingSingleFilePages: check remaining single-file gaps
  missingSingleFilePages-->>collectCompleteFileManifest: remaining missing slots or complete manifest
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • cblecker/claude-plugins#45: Introduces the review-pr skill workflow that this PR continues to update in the same review-pr.js manifest collection path.
  • cblecker/claude-plugins#54: Reworks the shared changed-file collection pipeline that this PR further adjusts around per-page pagination and recovery.
  • cblecker/claude-plugins#55: Modifies the same pagination/retry logic in review-pr.js, overlapping with the manifest recovery changes here.

Poem

I hopped through pages in the silver night,
Counted each slot till the counts felt right.
Missing crumbs got fetched with a brisk little thump,
Now the manifest settles with a happy bunny jump.
🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: recovering truncated file pages in pr-review-toolkit.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pr-review-toolkit-file-page-recovery

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reworks the changed-file manifest collection in the pr-review-toolkit workflow (review-pr.js) to better handle large PRs whose file pages get truncated. Previously, when a page came back incomplete the whole manifest was re-fetched at progressively smaller page sizes (10 → 5 → 1). The new approach fetches all pages at the full page size first, then surgically recovers only the truncated page ranges with perPage=1 single-file reads, preserving each recovered page's metadata. The agent prompt is also updated so file metadata is still returned even when the patch body is truncated.

Changes:

  • Replaces the whole-manifest size-reducing retry loop with a "complete-first, then recover-only-incomplete-ranges" strategy in collectCompleteFileManifest, adding helpers (filePageResultIssues, filePageIssueSummary, filePageNumbersForIssues, missingSingleFilePages).
  • Tags each page result with its perPage so mergeFilePages uses per-page values, and replaces FILE_RETRY_PAGE_SIZES with FILE_SINGLE_PAGE_RETRIES.
  • Updates the collector prompt to keep file metadata when patch bodies are truncated, and bumps the plugin to 1.6.2.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
pr-review-toolkit/skills/review-pr/review-pr.js Implements truncation-tolerant manifest collection with targeted single-file recovery and updated collector prompt.
pr-review-toolkit/.claude-plugin/plugin.json Bumps plugin version to 1.6.2.

I verified that the removed functions (validateFilePageResults, collectFileManifestAttempt) and the removed FILE_RETRY_PAGE_SIZES constant have no remaining references, that mergeFilePages correctly dedups recovered/primary pages by path, and that the page→single-file slot mapping is correct. I noted two minor nits (a misleading "retrying" log message on the final attempt, and two unused hardcoded return fields).


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pr-review-toolkit/skills/review-pr/review-pr.js Outdated
Comment thread pr-review-toolkit/skills/review-pr/review-pr.js Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pr-review-toolkit/skills/review-pr/review-pr.js`:
- Around line 1276-1299: The merge still includes suspect primary page results
even after recovery succeeds, so bad or stale entries can leak into the final
file list. Update the recovery flow in review-pr.js around primaryIssues,
recoveryResults, and mergeFilePages so that any page flagged by
filePageResultIssues is excluded from the primary set once its slots are
recovered. Keep only unflagged primaryResults plus the recovered results when
building pageResults, using the existing helpers filePageResultIssues,
filePageNumbersForIssues, and mergeFilePages to locate the logic.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 85668bba-2849-4f72-83ef-65e0ea3048c5

📥 Commits

Reviewing files that changed from the base of the PR and between 702a43d and 5de5296.

📒 Files selected for processing (2)
  • pr-review-toolkit/.claude-plugin/plugin.json
  • pr-review-toolkit/skills/review-pr/review-pr.js

Comment thread pr-review-toolkit/skills/review-pr/review-pr.js
Exclude suspect primary page results after successful single-file recovery, avoid misleading final-attempt retry logs, and drop unused manifest status fields.

Assisted-by: Codex:gpt-5
@cblecker
cblecker merged commit 6fad970 into main Jun 24, 2026
11 checks passed
@cblecker
cblecker deleted the fix/pr-review-toolkit-file-page-recovery branch June 24, 2026 19:39
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.

2 participants