Skip to content

fix(review): filter near-duplicate comments in review output - #776

Open
amh1k wants to merge 1 commit into
alibaba:mainfrom
amh1k:fix/review-filter-near-duplicates
Open

fix(review): filter near-duplicate comments in review output#776
amh1k wants to merge 1 commit into
alibaba:mainfrom
amh1k:fix/review-filter-near-duplicates

Conversation

@amh1k

@amh1k amh1k commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Description

This PR fixes near-duplicate review comments in JSON and GitLab output.

The existing review filter only received comment text and existing code, so it could not reliably identify comments targeting the same file and location. The filter payload now includes file paths, resolved line ranges, suggested code, categories, and severities.

The review-filter prompt now removes only high-confidence duplicates while preserving complementary or uncertain findings. Filtering remains fail-open if the LLM response is invalid or unavailable.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring (no functional changes)
  • Documentation update
  • CI / Build / Tooling

How Has This Been Tested?

  • Focused review-filter tests
  • Race-enabled full test suite
  • go vet ./...
  • gofmt -s -l .
  • git diff --check
  • go mod tidy with no module changes
  • Build verification
  • Manual testing (covered by deterministic fake LLM responses)

Tests cover duplicate removal, line-number resolution, metadata preservation, cross-file isolation, malformed responses, and fail-open behavior.

Checklist

  • My code follows the project's coding style (go fmt, go vet)
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or my feature works
  • New and existing unit tests pass locally
  • I have updated the documentation accordingly (not applicable)
  • I have signed the CLA

Related Issues

Closes #709

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

OpenCodeReview: Review complete: 0 finding(s) across 1 selected item(s).

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.

Near-duplicate comments in json output for agent

1 participant