fix(prompt): require stash-based reproduction before dismissing test failures#1327
Merged
Merged
Conversation
…failures Agents on SWE-bench Pro were declaring success after reasoning that a failing test was "flaky" or "pre-existing", without actually verifying this on the unmodified codebase. The ansible-11c177 case is a concrete example: the agent ran git stash + pytest to confirm the test passed without its changes, but the real issue was an ordering dependency that only surfaced in the full test suite. Add an explicit rule: a test failure may only be dismissed as pre-existing if `git stash && <test> && git stash pop` reproduces the failure. If the stashed run passes, the failure belongs to the patch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Using && to chain git stash, test, and git stash pop means a failing test (non-zero exit) silently skips git stash pop, leaving the patch stranded in the stash. Rewrite as separate steps with an explicit note to always run git stash pop regardless of test outcome. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
git stash && pytest test_timeout.py && git stash pop, saw it pass, and concluded the failure was unrelated — but the real issue was incomplete implementation causing ordering dependencies in the full test suitegit stash && <test> && git stash popreproduces the failure. If the stashed run passes, the failure belongs to the patch and must be fixedTest plan
🤖 Generated with Claude Code