fix(action-log): invalidate root cause when a Seer fix PR is closed - #121017
Draft
cvxluo wants to merge 1 commit into
Draft
fix(action-log): invalidate root cause when a Seer fix PR is closed#121017cvxluo wants to merge 1 commit into
cvxluo wants to merge 1 commit into
Conversation
…unmerged Co-authored-by: Claude <noreply@anthropic.com>
Comment on lines
+156
to
+168
| # than PullRequest ids, so a closed PR can't be traced back to a Seer run. | ||
| seer_opened_a_pr = state[LAST_COMPLETED_AUTOFIX_STEP] in ( | ||
| IssueAutofixStep.PR_CREATED, | ||
| IssueAutofixStep.PR_ITERATION, | ||
| ) | ||
|
|
||
| match entry.action: | ||
| case RootCauseIdentifiedAction() | SeerRCACompletedAction() if not current: | ||
| return emit(HAS_ROOT_CAUSE.value(True)) | ||
| case SetRegressedAction() if current: | ||
| return emit(HAS_ROOT_CAUSE.value(False)) | ||
| case PullRequestClosedAction(has_other_open_prs=False) if current and seer_opened_a_pr: | ||
| return emit(HAS_ROOT_CAUSE.value(False)) |
Contributor
There was a problem hiding this comment.
Root cause cleared for non-Seer PR closures after Seer workflow completed
LAST_COMPLETED_AUTOFIX_STEP tracks the furthest Seer step ever reached and never resets, so once Seer creates a PR the seer_opened_a_pr guard stay True forever. Any later PullRequestClosedAction(has_other_open_prs=False) — even for an unrelated user PR — will clear the root cause.
Evidence
track_last_completed_autofix_steponly advancesLAST_COMPLETED_AUTOFIX_STEP; once it reachesPR_CREATEDorPR_ITERATIONit stays there permanently (lines 249-267).track_root_causereads that same feature to decide whether Seer ever created a PR:state[LAST_COMPLETED_AUTOFIX_STEP] in (IssueAutofixStep.PR_CREATED, IssueAutofixStep.PR_ITERATION)(line 157).- When a
PullRequestClosedAction(has_other_open_prs=False)arrives andcurrentis True, root cause is unconditionally cleared if that guard is True (lines 167-168). - Example trigger: Seer PR is merged (issue resolves) → issue is reopened → user creates an unrelated PR and closes it (no other open PRs) → root cause is incorrectly cleared, even though the Seer diagnosis was correct.
- The code comment acknowledges the per-issue limitation but the permanent nature of
LAST_COMPLETED_AUTOFIX_STEPmakes the heuristic over-clear root cause for any future PR closure.
Identified by Warden · sentry-backend-bugs · HHH-TJ5
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.
No description provided.