Skip to content

fix: Post status updates for tracked review findings - #159

Closed
JuliusWallblom wants to merge 1 commit into
mainfrom
codex/status-update-for-historical-findings
Closed

fix: Post status updates for tracked review findings#159
JuliusWallblom wants to merge 1 commit into
mainfrom
codex/status-update-for-historical-findings

Conversation

@JuliusWallblom

Copy link
Copy Markdown
Contributor

Summary

  • Allows body-only COMMENT reviews when the handler has a status update body to submit.
  • Builds status updates from tracked unresolved/new findings so duplicate-suppressed historical issues still appear after autofix.
  • Keeps legacy already-mentioned fingerprints from forcing new status updates when they are not stored historical findings.

Validation

  • bun test apps/review-agent/src/webhook/handler.test.ts
  • bun run --cwd apps/review-agent typecheck
  • bunx biome check apps/review-agent/src/webhook/handler.ts apps/review-agent/src/webhook/handler.test.ts

@opendiff-agent

Copy link
Copy Markdown
Contributor

OpenDiff Summary

This PR updates apps/review-agent/src/webhook/handler.ts so the webhook can submit body-only COMMENT reviews when there is a status update to post, instead of skipping review submission when there are no inline comments.

  • Extends shouldSubmitReview() to allow COMMENT reviews with a non-empty body, which enables status-only review submissions.
  • Rebuilds status-update content from tracked history by converting stored findings back into CodeIssue objects via storedIssueToCodeIssue().
  • Filters history.newIssues against existingMentioned before deciding whether a status update is needed, so legacy duplicate fingerprints do not force fresh updates.
  • Updates apps/review-agent/src/webhook/handler.test.ts to expect submitReview() calls for repeated historical findings and addressed historical findings, rather than only updating the living summary comment.

Not safe to merge. The new body-only review submission path is directionally correct and I did not find security or performance regressions in the changed flow, but there is one behavior regression in the status body generation: when the only change is that previously tracked findings were resolved, the handler now posts a body-only review whose real formatter output collapses to a generic "No open issues in the current review." message instead of communicating that earlier findings were addressed. That does not break review submission itself, but it means the newly added feature fails to deliver the intended status update in an important path, so I would fix that before merging.

Findings

OpenDiff completed the review and found 1 warning to consider before merging.

Open Issues

Finding Issue Code
Bug Risk Addressed-only updates lose the resolved-status context. handler.ts:951

Rating: 84/100
Confidence: 83/100

Reviewed by opendiff

@opendiff-agent opendiff-agent Bot 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.

Status Update

Overview

  • ⚠️ 1 warning

Open Issues

  • apps/review-agent/src/webhook/handler.ts:951 Addressed-only updates lose the resolved-status context.

Comment on lines +951 to +953
statusUpdateOpenIssues.length > 0
? statusUpdateOpenIssues
: effectiveReviewResult.issues,

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.

Bug Risk: Addressed-only updates lose the resolved-status context.

When history.addressedIssues is non-empty and there are no remaining open findings, statusUpdateOpenIssues.length is 0, so this branch falls back to effectiveReviewResult.issues. In that case effectiveReviewResult.issues is also empty, and ReviewFormatter.formatReviewBody() produces the generic ## Status Update\n\nNo open issues in the current review. body. This PR now submits that body as a standalone COMMENT review, so the user never sees that earlier tracked findings were actually resolved, even though the tests now expect a resolution-focused status update.

Suggested change
statusUpdateOpenIssues.length > 0
? statusUpdateOpenIssues
: effectiveReviewResult.issues,
const reviewBody =
statusUpdateOpenIssues.length === 0 && history.addressedIssues.length > 0
? "## Status Update\n\nPreviously reported issues were addressed in this revision."
: this.formatter.formatReviewBody(
{
...effectiveReviewResult,
issues:
statusUpdateOpenIssues.length > 0
? statusUpdateOpenIssues
: effectiveReviewResult.issues,
},
statusUpdateOpenIssues.length > 0
? statusUpdateInlineIssues
: inlineIssues.filter(
(issue) =>
!invalidInlineIssues.some(
(invalidIssue) =>
invalidIssue.file === issue.file &&
invalidIssue.line === issue.line &&
invalidIssue.message === issue.message
)
),
statusUpdateBodyOnlyIssues
);

@JuliusWallblom

Copy link
Copy Markdown
Contributor Author

Closing so we can rerun review/autofix from a fresh PR after removing the autofix include and ignore path scopes.

@github-actions

Copy link
Copy Markdown

Preview Deployment

Service URL
Website https://pr-159.opendiff.dev
App https://pr-159-app.opendiff.dev
API https://pr-159-api.opendiff.dev
Agent https://pr-159-agent.opendiff.dev

Updated: 2026-06-25 12:48:38 UTC

@JuliusWallblom
JuliusWallblom deleted the codex/status-update-for-historical-findings branch June 25, 2026 12:51
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.

1 participant