fix(seer): Skip the iteration push when the PR is closed - #123831
Open
alexsohn1126 wants to merge 5 commits into
Open
fix(seer): Skip the iteration push when the PR is closed#123831alexsohn1126 wants to merge 5 commits into
alexsohn1126 wants to merge 5 commits into
Conversation
An iteration triggered by a comment on a closed PR pushed its changes anyway, so a close no longer stopped Seer from writing to the PR. Read the PR state before pushing and stop when every PR on the run is closed. A PR we cannot read counts as open, so a transient failure does not drop the changes. Fixes CW-1998 Claude-Session: https://claude.ai/code/session_017A4BhakBapTmqxiuspM29x
The completion-hook block still spent a whole agent run before finding the PR closed. Check at the front of the consume task too, so a closed PR costs one API read instead of an iteration. The queue is left intact rather than cleared: if the PR reopens, the feedback that arrived while it was closed is still worth draining. Claude-Session: https://claude.ai/code/session_017A4BhakBapTmqxiuspM29x
A push serves every repo on the run at once, so it cannot honor a close on one PR while still writing to the others. Treat one closed PR as the stop signal for the run rather than waiting for all of them to close. Claude-Session: https://claude.ai/code/session_017A4BhakBapTmqxiuspM29x
Both gates now write the pause marker, so a closed PR costs one read once rather than a read on every later trigger. The pause is one-way, as we have no signal to lift it on: nothing tells us a PR reopened. Add autofix.pr_iteration.pr_closed, tagged with the gate that caught it, so we can see how often a close lands mid-iteration versus before one starts. Claude-Session: https://claude.ai/code/session_017A4BhakBapTmqxiuspM29x
…ock-push-to-closed-pr # Conflicts: # src/sentry/seer/autofix/on_completion_hook.py
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.
previously seer would re-open the PR if the PR was closed:
this PR blocks the iteration from even starting if PR is closed and we block the RPC call to Seer to push the changes as well. the latter is for when PR is closed while the iteration is in-flight.