codeflash-internal/django
Kevin Turcios 0ca3a2ab07
fix: use greedy code extraction and retry on syntax errors in repair (#2475)
## Summary
- Switch `extract_code_block_with_context` (non-greedy `.*?`) →
`extract_code_block` (greedy `.*`) for repair code extraction — the
non-greedy regex matched the first closing fence, truncating code when
the LLM included explanatory snippets before the full file (root cause
of 82% of repair failures)
- Add `ast.parse` validation before CST parsing for fast syntax checking
- Retry the LLM once with the specific syntax error appended to the
conversation when validation fails

## Test plan
- [x] Existing tests pass
- [ ] Run end-to-end optimization to verify repairs succeed
2026-03-06 06:24:31 -05:00
..
aiservice fix: use greedy code extraction and retry on syntax errors in repair (#2475) 2026-03-06 06:24:31 -05:00
.dockerignore local setup (#1898) 2025-11-17 12:35:09 -08:00