feat(autofix): Push PR iteration changes and sync completion webhook#117220
Draft
joseph-sentry wants to merge 32 commits into
Draft
feat(autofix): Push PR iteration changes and sync completion webhook#117220joseph-sentry wants to merge 32 commits into
joseph-sentry wants to merge 32 commits into
Conversation
Contributor
|
🚨 Warning: This pull request contains Frontend and Backend changes! It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently. Have questions? Please ask in the |
ba8fbbd to
ece9167
Compare
ba1ab28 to
30f8ee6
Compare
ece9167 to
95e2abc
Compare
30f8ee6 to
61e5cd3
Compare
2156fc1 to
95e2abc
Compare
61e5cd3 to
30f8ee6
Compare
95e2abc to
aa2e40c
Compare
30f8ee6 to
6491a12
Compare
aa2e40c to
fa1434f
Compare
3e64907 to
597ff23
Compare
449edff to
fc3e813
Compare
a2a73f7 to
999e9ec
Compare
fc3e813 to
1eb4a41
Compare
999e9ec to
30447ab
Compare
1eb4a41 to
af07440
Compare
30447ab to
f1c753c
Compare
af07440 to
87f856e
Compare
f1c753c to
65c26eb
Compare
87f856e to
59f0a94
Compare
_hydrate_feedback_users assumed every block message carried a metadata dict, but messages can have metadata set to null. Calling .get() on the result crashed when hydrating feedback users. Coalesce metadata to an empty dict before reading the feedback field. Co-Authored-By: Claude <noreply@anthropic.com>
Patch get_autofix_run_state (not get_autofix_agent_state) in pr_iteration tests, and add the feedback=None kwarg to trigger_autofix_agent call assertions.
Send the ITERATION_COMPLETED webhook when a PR_ITERATION step finishes, including the pull request payload, code changes, and iteration index, and record the iteration index on the introspection analytics event. Add introspect_iteration to evaluate whether revised iteration changes are ready to update the existing pull request, and route PR_ITERATION through it. Extract the pull-request and code-changes payload builders into shared helpers. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Accept the pr_iteration step in the explorer autofix endpoint, gated behind the autofix-pr-iteration feature flag. The step requires an existing run with at least one created pull request, otherwise it returns a 400. Map the SEER_ITERATION_COMPLETED webhook to a SEER_ITERATION_COMPLETED group activity in the operator, carrying the pull requests and iteration index. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Patch get_autofix_run_state (not get_autofix_agent_state) in pr_iteration tests, and add the feedback=None kwarg to trigger_autofix_agent call assertions.
Send the ITERATION_COMPLETED webhook when a PR_ITERATION step finishes, including the pull request payload, code changes, and iteration index, and record the iteration index on the introspection analytics event. Add introspect_iteration to evaluate whether revised iteration changes are ready to update the existing pull request, and route PR_ITERATION through it. Extract the pull-request and code-changes payload builders into shared helpers. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Send the ITERATION_COMPLETED webhook when a PR_ITERATION step finishes, including the pull request payload, code changes, and iteration index, and record the iteration index on the introspection analytics event. Add introspect_iteration to evaluate whether revised iteration changes are ready to update the existing pull request, and route PR_ITERATION through it. Extract the pull-request and code-changes payload builders into shared helpers. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Send the ITERATION_COMPLETED webhook when a PR_ITERATION step finishes, including the pull request payload, code changes, and iteration index, and record the iteration index on the introspection analytics event. Add introspect_iteration to evaluate whether revised iteration changes are ready to update the existing pull request, and route PR_ITERATION through it. Extract the pull-request and code-changes payload builders into shared helpers. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Surface the PR iteration dimensions on the autofix analytics, metrics, and logs so iteration runs can be segmented and correlated. - Add pr_iteration_enabled to the AiAutofixPhaseEvent base so all phase events carry it, and populate it (plus iteration_index) on the started, completed, and introspection events. - Tag the autofix.explorer.trigger and autofix.explorer.complete metrics with iteration_index and pr_iteration_enabled. - Include both dimensions in the introspection, continuing_pipeline, and trigger webhook-failure logs. - Extract an is_pr_iteration_enabled(state) helper to avoid repeating the metadata lookup across emission sites. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
we want to be able to trace through the execution of a given autofix run via these events, if we don't have run_id then it's more difficult
Send the ITERATION_COMPLETED webhook when a PR_ITERATION step finishes, including the pull request payload, code changes, and iteration index, and record the iteration index on the introspection analytics event. Add introspect_iteration to evaluate whether revised iteration changes are ready to update the existing pull request, and route PR_ITERATION through it. Extract the pull-request and code-changes payload builders into shared helpers. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Send the ITERATION_COMPLETED webhook when a PR_ITERATION step finishes, including the pull request payload, code changes, and iteration index, and record the iteration index on the introspection analytics event. Add introspect_iteration to evaluate whether revised iteration changes are ready to update the existing pull request, and route PR_ITERATION through it. Extract the pull-request and code-changes payload builders into shared helpers. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
When a PR iteration run finishes, the agent's new file patches still need to be pushed to the existing PR. Trigger that push from the completion hook so the PR is updated, and only emit the iteration completion webhook on the synced pass so the payload reflects the updated PR and we don't double-fire. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
65c26eb to
b13daf5
Compare
59f0a94 to
1786047
Compare
Contributor
Backend Test FailuresFailures on
|
b13daf5 to
ce32e64
Compare
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.
When a PR iteration run finishes, the agent's new file patches still need
to be pushed to the existing PR. Trigger that push from the completion
hook so the PR is updated, and only emit the iteration completion webhook
on the synced pass so the payload reflects the updated PR and we don't
double-fire.
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.