Skip to content

perf(review): pre-analysis of a 17-file pull request takes four minutes because it refreshes metadata for 2,339 files #1919

Closed

Description

@dan-petty

Problem

devops review pr <N> --pre-analysis-only takes more than four minutes and makes no model call. A person ran it on 2026-10-22 against a merged pull request that changed 22 files. The run reviewed 17 of them.

Evidence

  • The output of the run, in this order: Content spans 17 pages to ensure full coverage., then Pre-analysis metadata refreshed with AI metadata for 2339 file(s), then Profile: 4m 6s, 0 LLM calls; pre_analysis 4m (0 calls), payloads 5.41s (0 calls), then Elapsed: 4m 23s.
  • The pre-analysis stage took 4 minutes for a change of 17 files. The line about 2339 files suggests that the stage refreshes the metadata of the whole repository on each run and not only of the changed files.
  • The message Initializing review pipeline session ... via LLM server appears for a run that makes 0 model calls, and Content spans 17 pages names pages where the count is a file count. Both are misleading.
  • The project rule says that a slow devops ci or review loop is a critical fix, because it delays every change.

Remedy

Measure first: run the stage with a profiler or with the stage timings that the profile line already holds, and find out which part takes the four minutes. Refresh the metadata of the changed files only, or reuse the cached metadata when the file hash is unchanged. Do not build a cache layer by hand if a library or an existing cache in the project already covers it. Fix the two misleading messages. Add a test that fails if the stage touches more than the changed files.

Proposed design

Problem statement

The pre-analysis stage in devops review takes four minutes for a small pull request. It refreshes metadata for all repository files instead of only changed files.

Acceptance criteria

  • Criterion 1: The pre-analysis stage refreshes metadata only for changed files.
    Verification: Run devops review pr --pre-analysis-only on a PR that changes 17 files. Check that the output shows metadata refreshed for only those 17 files, not 2339.
  • Criterion 2: The pre-analysis stage completes in under 30 seconds.
    Verification: Run devops review pr --pre-analysis-only on a PR that changes 17 files. Measure the time and confirm it is less than 30 seconds.
  • Criterion 3: Misleading messages are fixed.
    Verification: Run devops review pr --pre-analysis-only. Check that messages no longer say 'Content spans 17 pages' or 'Initializing review pipeline session ... via LLM server' for runs with zero model calls.

Key questions

  • What is the expected behavior for metadata refresh?: The stage should refresh metadata only for changed files, not the entire repository. (proposed)

Open questions

  • Does the pre-analysis stage refresh metadata for all repository files? (missing verified source)

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    on Oct 22, 2026
  2. dan-petty commented on Oct 22, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Type: type/bug. The candidate describes a performance issue that slows down the review process.
    • Priority: P1-High. A slow review loop delays every change and is marked as critical.
    • Value: High. Users experience long wait times during code reviews which impacts productivity.
    • Effort: Medium. The fix requires profiling, identifying the root cause, and changing metadata refresh logic.
  3. added a commit that references this issue on Oct 23, 2026
    45f1669
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

    source/agenttype/bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions