Skip to content

feat(autofix): Send PR feedback on single-run PRs to the run - #130881

Draft
NicoHinderling wants to merge 7 commits into
masterfrom
nico/feat/autofix-single-run-pr-feedback
Draft

NicoHinderling wants to merge 7 commits into
masterfrom
nico/feat/autofix-single-run-pr-feedback

Conversation

@NicoHinderling

@NicoHinderling NicoHinderling commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

PR comments, reviews and CI failures on single-run PRs were dropped. They now continue that run, and the agent pushes to the same PR (AIML-3825).

  • The drain hands feedback to the single run; caps, queueing and reactions are shared with multi-step
  • Completion closes the iteration and drains queued feedback. Edits the agent leaves unpushed are recorded as not_pushed and counted, not pushed by Sentry
  • Single-run chat lines skip Autofix prompt redaction

Needs getsentry/seer#9544 deployed first.

card

PR iteration found the single run behind a PR, then dropped its feedback because the run was not a step-by-step Autofix run. It now continues the single run with the feedback. The turn carries the PR iteration metadata, so caps and cards count it, and the chat shows a short notice line.
A single-run reply to PR feedback now ends its iteration like a step-by-step one: it drains feedback queued while the run was busy, records the outcome, and reacts on GitHub. An errored reply fails the iteration.
… queue

PR feedback pushes for single runs no longer force-push over commits others added to the branch. Edits the agent left unpushed are pushed the way PR iteration pushes them, so they don't block later feedback. Feedback queued during any single-run turn is drained when it finishes.
Before pushing edits a single-run feedback turn left unpushed, check that the PR is still open, as PR iteration does. A closed or merged PR pauses the run instead of getting a push.
Autofix step prompts are replaced with "Started Autofix" in run responses, and single-run PR feedback turns carry the pr_iteration step, so their short notice lines were hidden too. Single runs never store a step prompt in a user message, so leave their messages as they are.
Keep tracing on the feedback drain, inline its single-run branch, pass force-push as a settings argument, and drop a new comment.
Drop Sentry's fallback push for single-run PR feedback turns. When the agent leaves edits unpushed, record the iteration as not_pushed, count it, and hand over the next queued feedback. The drain now holds single runs only while a push is in flight.
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 12, 2026
Comment on lines 238 to 239
if group is None:
return

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.

Single-run PR feedback skips missing-group iteration finalization

When a completed single-run PR feedback turn cannot resolve its group, _complete_single_run returns before calling fail_pr_iteration_missing_group. The triggered iteration is therefore not immediately finalized with the MISSING_GROUP_ID outcome; it remains until the stale-row sweep eventually removes it and records NEVER_COMPLETED.

Evidence
  • _complete_single_run identifies completed PR feedback turns, but returns immediately when _fetch_group returns None.
  • The multi-step completion path handles the same missing-group case by calling fail_pr_iteration_missing_group.
  • fail_pr_iteration_missing_group calls complete_pr_iteration_details with MISSING_GROUP_ID; that completes and removes the triggered iteration row without needing a Group object.
  • Without that call, the row is left for the stale-row sweep, which reports a triggered stale row as NEVER_COMPLETED.

Identified by Warden · sentry-backend-bugs · ZW7-PR8

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant