Skip to content

fix: restrict codex review to added lines only and remove summary#42

Closed
zsculac wants to merge 1 commit intomainfrom
improvement/update-codex-review
Closed

fix: restrict codex review to added lines only and remove summary#42
zsculac wants to merge 1 commit intomainfrom
improvement/update-codex-review

Conversation

@zsculac
Copy link
Contributor

@zsculac 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.
Copy link

Choose a reason for hiding this comment

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

🟡 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) {
Copy link

Choose a reason for hiding this comment

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

🟡 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.

@zsculac zsculac closed this Mar 4, 2026
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