Skip to content

feat(review): scale to large diffs (chunk by file or hunk, merge findings) and let a repo exclude paths from the reviewed diff #720

Closed

Description

@ajianaz

Found while running cora review as the merge gate of codecoradev/tole (0.20.0, cora-review-action@v1). Related: #718 (an unparseable reply after "No issues found", finish_reason=length).

What happens

On larger pull requests Cora Review fails or is very slow while every other check is done in 4 to 6 minutes:

  • +492/-22 lines: 13 minutes. +1366/-26: 12 minutes. A release PR (122 commits, 243 files, +76 597/-1 599): the comment says "Review could not complete. Cora produced an empty result", and the same on one rerun.
  • The job concludes success, so the required check is green while the review did not happen. A maintainer has to read the comment to notice.

Findings

  1. No scaling to a large diff. The whole diff goes into one model request; a reply that does not fit (finish_reason=length, empty result) fails the whole run instead of degrading.
  2. No way to exclude paths from the reviewed diff. ignore.files in .cora.yaml scopes the symbol index and the context chain only. I confirmed it: cora review --no-llm on a diff touching an ignored path still reports a finding there. cora-review-action@v1 has no path-exclude input either. Docs-only and generated files (CHANGELOG.md, docs/**, lockfiles) always count toward the size.
  3. A review that did not complete reports success. The job should fail (red) or the comment should be a distinct status, not a green job with a warning in a comment.

Suggested fix

  • Chunk the diff by file or hunk with a token budget per request, review the chunks (in parallel with a cap), merge and de-duplicate the findings, and state in the comment which files were reviewed and which were skipped for size.
  • Add review.exclude (globs) in .cora.yaml and an exclude input to the action, applied to the diff the reviewer reads (not only the index). Excluded files are listed in the comment.
  • Make an incomplete review fail the job by default (--fail-on-incomplete, default on in the action), with an opt-out.
  • Record the size at which a single request fails (changed lines and tokens) in the docs so repos can set a guideline.

Acceptance

  • A 76k-line diff produces a review (possibly partial, with the skipped files named) instead of an empty result.
  • A path matched by review.exclude produces no finding and is named in the comment.
  • A review that could not finish turns the job red.

Activity

  1. added
    enhancement
    on Nov 14, 2026
  2. ajianaz commented on Nov 14, 2026

    @ajianaz
    CollaboratorAuthor

    Pattern worth considering for this design (from Alibaba open-code-review, Apache-2.0): file bundling — group related files into one review unit (they bundle e.g. locale pairs; for us: files connected by CALLS/IMPORTS edges, which we already store in cora.db), each bundle reviewed as an isolated sub-unit, concurrently. Complements hunk-chunking: chunk within a bundle, merge findings per bundle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions