Skip to content

Commit 6c4de8c

Browse files
committed
Implement 'one file at a time' diff generation strategy
MAJOR CHANGE: Generate diffs one file at a time instead of all at once Strategy: 1. First API call: Identify which files need modification 2. For each file: Generate complete diff individually 3. Combine all file diffs into final patch 4. Hard validation before patch application Benefits: - LLMs handle single-file diffs much better than multi-file - Each diff is guaranteed complete (has ---, +++, and @@) - Eliminates truncated diff issues - Falls back to single-pass if file identification fails Additional improvements: - Hard validation: Check for +++ b/ and @@ markers before applying - Verify each file section is complete - Better error messages with specific validation failures - Improved prompts with stricter format requirements - File existence verification This should completely solve the '+++ b/p' truncation problem.
1 parent 21a2509 commit 6c4de8c

1 file changed

Lines changed: 334 additions & 73 deletions

File tree

0 commit comments

Comments
 (0)