feat(review): allow empty review when nothing new#78
Open
fshehadeh-sfl wants to merge 2 commits into
Open
Conversation
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.
Contributor
There was a problem hiding this comment.
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
commentsarray 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. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.prompts/system_gerrit_review.md,system_github_review.md,system_gitlab_review.md) — state that an emptycommentsarray 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 errorsnpm run lint— cleannpm test— 1609 passed