Skip to content

feat(autofix): Add retry buttons to Autofix v3 step cards#112290

Draft
isaacwang-sentry wants to merge 17 commits intomasterfrom
isaacwang-sentry/feat/autofix-retry-from-step-ui
Draft

feat(autofix): Add retry buttons to Autofix v3 step cards#112290
isaacwang-sentry wants to merge 17 commits intomasterfrom
isaacwang-sentry/feat/autofix-retry-from-step-ui

Conversation

@isaacwang-sentry
Copy link
Copy Markdown
Member

Add "Retry" icon buttons to completed step cards (Plan, Code Changes, Pull Requests) in
the Autofix v3 Explorer drawer. Clicking the button re-runs that step on the existing run
without requiring feedback text — useful for iterating on Seer changes locally.

Gated behind the autofix-retry-from-step feature flag registered in #112287.
RootCauseCard is excluded since the header "Start Over" button already covers that case.

Depends on #112287

Add a new Flagpole feature flag to gate "Retry from step" buttons on
Autofix v3 cards. This is primarily useful for local Seer testing,
allowing developers to re-run individual autofix steps without
restarting the entire flow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 6, 2026
@isaacwang-sentry isaacwang-sentry force-pushed the isaacwang-sentry/feat/autofix-retry-from-step-ui branch from cab7212 to e7f6ee2 Compare April 6, 2026 20:59
Pass insert_index from the API serializer through
trigger_autofix_explorer to client.continue_run. When provided,
Seer truncates blocks after that index, enabling retry-from-step
to properly reset downstream steps.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@isaacwang-sentry isaacwang-sentry force-pushed the isaacwang-sentry/feat/autofix-retry-from-step-ui branch from e7f6ee2 to 0eca46e Compare April 6, 2026 22:05
The retry buttons are no longer gated behind a feature flag, so
this registration is unnecessary.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The test_stopping_point test checks exact kwargs passed to
trigger_autofix_explorer. Add the new insert_index=None parameter
to match the updated function signature.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
trailingItems={
section.status === 'completed' && artifact?.data ? (
<RetryButton
onClick={() => startStep('root_cause', runId, undefined, section.blockIndex)}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right now it seems like "restart from scratch" calls startStep with runId=undefined, which creates a fresh run state that's then picked up by group_ai_autofix endpoint. This could be intentional so we have the record of the previous run for debugging. Could we do that here?

Suggested change
onClick={() => startStep('root_cause', runId, undefined, section.blockIndex)}
onClick={() => startStep('root_cause')}

frontend behavior should look the same since blockIndex is 0. Thoughts on removing the header button now that we have these?

Image

isaacwang-sentry and others added 4 commits April 7, 2026 15:21
Verify that insert_index from the POST request is threaded through
to trigger_autofix_explorer for retry-from-step functionality.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a "Retry" icon button to completed step cards (Plan, Code Changes,
Pull Requests) in the v3 Explorer drawer. Clicking the button re-runs
that step on the existing run without requiring feedback text.

Gated behind the `autofix-retry-from-step` feature flag so it only
appears for local Seer testing. RootCauseCard is excluded since the
header's "Start Over" button already covers that case.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When retrying from a step, pass the section's block index as
insert_index so Seer truncates all blocks after that point. This
ensures downstream sections (e.g. Code Changes after retrying Plan)
are removed and the normal NextStep flow resumes after the retried
step completes.

Changes:
- Add blockIndex to AutofixSection, tracked in getOrderedAutofixSections
- Add insertIndex parameter to startStep
- Pass section.blockIndex in retry button handlers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Retry buttons are now always visible on all completed step cards
including Root Cause. The feature flag check has been removed since
this is intended as a standard feature, not gated functionality.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
isaacwang-sentry and others added 9 commits April 7, 2026 15:21
Only show the synthetic PR and coding-agent sections when a completed
code_changes section exists. After retrying an earlier step, blocks
are truncated but repo_pr_states persists on the run state, causing
the PR card to remain visible and preventing NextStep buttons from
appearing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- NextStep now skips synthetic sections (pull_request, coding_agents)
  when finding the last section, so correct next-step buttons appear
  even when stale PR data persists
- CodeChangesNextStep shows "Yes, update the PR" when a PR already
  exists, "Yes, draft a PR" otherwise
- PullRequestsCard shows "Update" button when code has changed since
  the PR was last pushed, "View" link when in sync

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The PR card now only appears when all PRs match the current code
changes (commit SHA comparison). This prevents the PR card from
showing above the "Are you happy with these code changes?" prompt.

- Added areAllPRsInSync() helper for commit SHA comparison
- PR section hidden when code is out of sync or no PR exists yet
- CodeChangesNextStep returns null when all PRs are in sync

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When the user clicks "Yes, draft/update a PR", immediately show a
"Creating PR..." or "Updating PR..." message instead of leaving the
NextStep prompt visible during the backend roundtrip.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When user clicks to create/update PR, immediately hide the NextStep
prompt and show the PR card with a disabled "Creating/Updating PR"
button. The button text distinguishes between new PRs and updates.

The PR section now also appears during the 'creating' status, not
just when fully in sync.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When PR creation fails, show a clickable "Retry PR" button instead
of a disabled "Failed to create PR" button.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add missing blockIndex property to makeSection helpers in test files
and pr_commit_shas to the autofixSection PR test to match the new
sync-aware PR section logic.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove the no-op refresh button from PullRequestsCard header and the
dead isOutOfSync/Update code. The error state now shows
"Failed to create PR — Retry" as a clickable button. Closed PRs are
handled by the normal rerun flow (Seer reopens them automatically).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Show the PR section when any PR has an error status, so the
"Failed to create PR — Retry" button is visible. Stale errors
after retrying earlier steps are cleared on the Seer side.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@isaacwang-sentry isaacwang-sentry force-pushed the isaacwang-sentry/feat/autofix-retry-from-step-ui branch from 4e806e5 to 292ccf9 Compare April 7, 2026 22:21
isaacwang-sentry added a commit that referenced this pull request Apr 7, 2026
#112287)

Thread `insert_index` through the explorer autofix API so the frontend
can request
a retry-from-step that truncates all downstream blocks. When provided,
Seer does
`blocks = blocks[:insert_index]` before re-running the step, ensuring
downstream
sections (e.g. Code Changes after retrying Plan) are properly removed.

Changes:
- Add `insert_index` field to `ExplorerAutofixRequestSerializer`
- Pass it through `trigger_autofix_explorer()` → `client.continue_run()`

A follow-up frontend PR (#112290) adds retry buttons that use this
parameter.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Base automatically changed from isaacwang-sentry/feat/autofix-retry-from-step-flag to master April 7, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants