Bug Report: `_extract_patch` and `_extract_patch_from_text` fail to extract patches from Claude-4 Anthropic format
- Dominant language
- TypeScript
- Stars
- 72.7k
- Forks
- 8.6k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 85
Description
## Summary
The patch extraction methods in `official_integration.py` are unable to correctly extract git diff patches from Claude-4 output due to changes in the Anthropic API response format. This results in empty patches being extracted, causing the SWE-bench evaluation to fail.
## Problem Description
### Current Behavior
- `_extract_patch()` and `_extract_patch_from_text()` methods return empty strings
- SWE-bench instances show "No patch found in content" warnings
- Success rate drops significantly due to failed patch extraction
### Expected Behavior
- Methods should correctly extract git diff patches from Claude-4 output
- Patches should be properly formatted for SWE-bench evaluation
- High success rate for patch generation and extraction
Contributor guide
Research direction
Start in official_integration.py by reading _extract_patch() and _extract_patch_from_text(), then run the SWE-bench evaluation to reproduce the "No patch found in content" warnings. Compare the methods' handling of Claude-4 Anthropic output with the expected git diff format. Done means non-empty, properly formatted patches are extracted and the affected SWE-bench evaluations no longer fail for this reason.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- ai, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100