fix: restrict codex review to added lines only and remove summary#42
Closed
fix: restrict codex review to added lines only and remove summary#42
Conversation
Contributor
zsculac
commented
Mar 4, 2026
- Only allow inline comments on added lines (not context lines in the diff), preventing comments on unchanged code
- Remove top-level summary comment from PR review to reduce clutter
- Skip review creation entirely when there are no valid inline comments
- Only allow inline comments on added lines (not context lines in the diff), preventing comments on unchanged code - Remove top-level summary comment from PR review to reduce clutter - Skip review creation entirely when there are no valid inline comments Ported from staking-ui improvements. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| if (line.startsWith('\\')) continue; | ||
| // Context lines on the right side are also valid targets | ||
| validLines.add(`${file.filename}:${currentLine}`); | ||
| // Context lines are intentionally not valid targets. |
There was a problem hiding this comment.
🟡 Issue: Restricting valid targets to added lines only will drop legitimate comments on right-side context lines within a diff hunk, even though the review prompt allows using nearby unchanged hunk lines when necessary. Include right-side context lines in validLines (added + context) to avoid silently losing valid findings.
| // Build review body from summary only. | ||
| // Intentionally do NOT publish out-of-diff comments. | ||
| let body = review.summary || 'Codex review complete.'; | ||
| if (validComments.length === 0) { |
There was a problem hiding this comment.
🟡 Issue: Returning early when validComments is empty suppresses all PR feedback, including the generated summary, so clean PRs or fully-filtered outputs look like no review ran. Add a fallback createReview call with a summary/body when there are zero inline comments.
Balki-OriginTrail
approved these changes
Mar 4, 2026
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.