Skip to content

Make files_reviewed count dispatchable files and reconcile it with preview #480

Closed

Description

@acoliver

OpenCodeReview version

Observed with v1.7.9. Verified by source inspection to remain present in v1.7.15.

Release: https://github.com/alibaba/open-code-review/releases/tag/v1.7.15

Operating system

Linux x86_64 on GitHub Actions.

Installation method

npm global installation with an exact OCR version.

LLM provider

Other OpenAI-compatible endpoint. This accounting defect is provider-independent.

Bug description

The JSON files_reviewed field can count files that were never dispatchable or reviewed, so it does not reliably reconcile with preview-selected files or actual per-file execution.

In v1.7.15:

Large-diff filtering also occurs at a different stage, which can move the count in the opposite direction. Consequently, preview-selected, dispatched, completed, and files_reviewed do not share one documented vocabulary.

Production evidence:

The preview selected 63 files, while final JSON reported 68 files_reviewed. The PR contained six removed files. Deleted files retained in the broad diff collection but skipped by dispatch explain why the reported value can exceed the selected/dispatchable count; later large-diff filtering can offset part of that difference. The exact +5 composition is less important than the direct source-level accounting mismatch.

This makes runtime, cost, completeness, and regression measurements unreliable. It also prevents downstream automation from distinguishing complete coverage from an inflated aggregate count.

Steps to reproduce

  1. Create a review range containing:
    • at least one modified reviewable file;
    • at least one deleted file;
    • optionally one file excluded by the large-diff filter.
  2. Run preview with JSON output and record total/excluded/selected counts.
  3. Run the review over the same exact range and record files_reviewed and any per-file/session records.
  4. Observe that files_reviewed is derived from the retained diff slice rather than the files actually dispatched or completed.

A deterministic unit/integration test can avoid provider calls by exercising preview, filtering, dispatch eligibility, and result assembly over fixture diffs.

Expected behavior

Define one documented file-accounting vocabulary and use it consistently in preview, JSON, sessions/manifests, and telemetry. At minimum distinguish:

  • total diffs;
  • eligible files;
  • selected files;
  • prefiltered or oversized files;
  • dispatched files;
  • reused files;
  • completed files;
  • failed files;
  • waived/skipped files;
  • deleted files.

For the legacy files_reviewed field:

  • It must not include deleted or otherwise undispatched diffs.
  • Its exact meaning must be documented, preferably completed plus safely reused files.
  • Preview must apply the same relevant selection stages as review execution, or clearly report why later prefilters can change scope.
  • JSON and OpenTelemetry counters must reconcile.
  • Terminal success/no-findings must not be inferred from an inflated count.

Tests should cover deleted, excluded, unsupported, oversized, resumed/reused, completed, failed, and mixed-file ranges.

Logs / error output

There is no explicit error. The observable mismatch is:

  • preview selected: 63
  • final files_reviewed: 68

Run and artifact source:

https://github.com/vybestack/llxprt-code/actions/runs/29946076923

Additional context

The immutable manifest proposal in #367 is adjacent and should define the richer final vocabulary, but this is a released aggregate-count bug that should not remain hidden until that larger feature ships.

Related:

Activity

  1. added theissue type on Jul 23, 2026
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

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions