Skip to content

feat(review): allow empty review when nothing new#78

Open
fshehadeh-sfl wants to merge 2 commits into
mainfrom
feat/review-prompt-no-redundant-comments
Open

feat(review): allow empty review when nothing new#78
fshehadeh-sfl wants to merge 2 commits into
mainfrom
feat/review-prompt-no-redundant-comments

Conversation

@fshehadeh-sfl

Copy link
Copy Markdown
Collaborator

Summary

Reinforce the code-review prompt so the agent (1) is reminded of the comments Virtual Engineer already posted and explicitly told not to repeat them, and (2) is free to return no comments when a re-review finds nothing genuinely new — instead of inventing filler comments just to have something to say.

Changes

  • src/review/reviewPromptBuilder.ts — in the "Already reported (do not repeat)" block, instruct the agent to return an empty comments list rather than repeat prior points or fabricate comments.
  • System review prompts (prompts/system_gerrit_review.md, system_github_review.md, system_gitlab_review.md) — state that an empty comments array is a valid, expected result and that points from the "Already reported" section must never be re-raised.
  • tests/unit/reviewPromptBuilder.test.ts — new test asserting the empty-comments guidance appears when prior comments are injected.

Context

The prompt already injects VE's previously-posted comments as an "Already reported (do not repeat)" checklist; this change makes the "don't repeat / nothing-new is fine" intent explicit both in the builder and in the per-provider system prompts. Existing hash-based dedup (posted_review_comments) and the no-re-post skip remain unchanged.

Validation

All gates green on branch HEAD:

  • npm run typecheck — zero errors
  • npm run lint — clean
  • npm test — 1609 passed

Reinforce the review prompt so the agent does not re-raise points it
already made and is free to return no comments when a re-review finds
nothing genuinely new.

- reviewPromptBuilder: in the "Already reported (do not repeat)" block,
  tell the agent to return an empty comments list rather than repeat
  prior points or invent filler comments.
- system review prompts (gerrit, github, gitlab): state that an empty
  comments array is a valid, expected result and never re-raise points
  from the "Already reported" section.
- add a reviewPromptBuilder test asserting the empty-comments guidance.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR strengthens the review-agent prompting so that, on re-reviews, the agent is explicitly instructed not to repeat already-posted Virtual Engineer comments and is allowed to return an empty comments result when there are no genuinely new issues to raise.

Changes:

  • Updates buildReviewPrompt’s “Already reported (do not repeat)” section to explicitly allow returning no new inline comments when nothing new is found.
  • Updates provider-specific system review prompts (Gerrit/GitHub/GitLab) to state that an empty comments array is valid and expected when there are no new actionable issues.
  • Adds a unit test asserting the empty-comments guidance appears when prior comments are injected.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/review/reviewPromptBuilder.ts Adds explicit guidance in the prior-comments memory block allowing an empty comments result when nothing new is found.
prompts/system_gerrit_review.md States that empty comments is valid on “no new issues” re-reviews and forbids re-raising “Already reported” points.
prompts/system_github_review.md Same as above for GitHub review formatting/rules.
prompts/system_gitlab_review.md Same as above for GitLab review formatting/rules.
tests/unit/reviewPromptBuilder.test.ts Adds coverage to ensure the new “empty comments allowed” guidance is present in the built prompt.

Comment thread src/review/reviewPromptBuilder.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

2 participants