Skip to content

Review Output Randomly Changes to Incorrect / Unrelated Reviews #74

@TejasGtech

Description

@TejasGtech

Bug: Review Results Randomly Change to Incorrect / Unrelated Reviews

Description

While testing git-lrc review, I noticed that the review output is unstable and sometimes changes unexpectedly after the initial review is generated.

The first review is often correct for the current file changes, but after a few moments the review content changes and starts showing:

  • unrelated architecture summaries
  • incorrect technical highlights
  • reviews for code that does not exist in the current diff
  • completely unrelated project descriptions

In some cases, the generated review is not even 1% related to the actual file content.

This appears to be either:

  • stale diff/context reuse
  • cached review contamination
  • prompt/context leakage
  • incorrect diff loading
  • asynchronous review overwrite race condition

Steps to Reproduce

  1. Create a very small Python file:
print("hello")
print("code review")qaww
  1. Run:
git lrc review
  1. Observe the generated review.

  2. Initially, the review may look correct or partially correct.

  3. After some time, the review content suddenly changes and shows unrelated summaries.


Expected Behavior

The review should consistently analyze only the current git diff/file changes.

Example expected review:

  • simple print statement changes
  • no major issues detected

Actual Behavior

The review suddenly changes into unrelated summaries such as:

  • "Implement Async SQS Batch Processing for Lambda"
  • AWS/S3/SQS architecture comments
  • Lambda processing summaries
  • unrelated backend/system descriptions

even though the actual file only contains simple print statements.


Screenshots / Evidence

Actual file content

print("hello")
print("code review")qaww

Incorrect generated review

The review generated unrelated AWS Lambda/SQS architecture summaries and multiple comments not related to the file.

| Review Output
Image

| Code folder and terminal
Image

| Video proof of crashing issue

git-lrc.problem.mp4

Possible Root Causes

  • Previous review context being reused
  • Cached diffs not cleared
  • Prompt contamination
  • Async review state overwrite
  • Incorrect preloaded diff handling
  • Shared review session memory

Environment

  • OS: Windows 11
  • VS Code terminal
  • git-lrc CLI
  • Review provider: Gemini API KEY

Additional Notes

This issue can reduce trust in the review system because unrelated reviews appear for very small/simple changes.

The problem seems more visible when:

  • running multiple reviews
  • reviewing tiny diffs
  • re-running review commands quickly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions