Skip to content

fix(autofix): Reset sections on re-run#110644

Merged
Zylphrex merged 1 commit intomasterfrom
txiao/fix/reset-section-on-re-run
Mar 13, 2026
Merged

fix(autofix): Reset sections on re-run#110644
Zylphrex merged 1 commit intomasterfrom
txiao/fix/reset-section-on-re-run

Conversation

@Zylphrex
Copy link
Member

When the same step is re-run, the contents from the previous run should be discarded to make for a cleaner loading state.

When the same step is re-run, the contents from the previous run should be
discarded to make for a cleaner loading state.
@Zylphrex Zylphrex requested a review from a team as a code owner March 13, 2026 16:28
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 13, 2026
finalizeSection();
}

section = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: The mergedByFile map is not cleared when a step re-runs, causing artifacts from previous runs to be incorrectly included in the output.
Severity: MEDIUM

Suggested Fix

When a step re-run is detected within the getOrderedAutofixSections function, clear the mergedByFile map. This should happen inside the if (metadata.step === section.step) block to ensure each step execution starts with a clean state.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: static/app/components/events/autofix/useExplorerAutofix.tsx#L379

Potential issue: In the `getOrderedAutofixSections` function, the `mergedByFile` map
accumulates file patches. When a step like `code_changes` is re-run, the logic is
intended to discard the previous run's results. However, while the current `section` is
reset, the `mergedByFile` map is not cleared. This causes file patches from the previous
run to be carried over. If the re-run generates new patches, the final artifacts will
incorrectly contain both the old and new patches, rather than just the results from the
most recent run.

Did we get this right? 👍 / 👎 to inform future reviews.

@Zylphrex Zylphrex merged commit 08eec0b into master Mar 13, 2026
64 checks passed
@Zylphrex Zylphrex deleted the txiao/fix/reset-section-on-re-run branch March 13, 2026 17:26
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