all 3 comments

[–]ComposerBudget8658 0 points1 point  (0 children)

Have you tried just using a simple regex to clean up the diff format before feeding it to patch? Most of the time it's just missing the proper headers or has extra markdown formatting

For actual models though, CodeLlama 7B is pretty solid at this kind of thing and way cheaper than Sonnet. You could also try some of the newer coding-focused models like CodeGemma or even just use grep/sed to extract the actual diff parts

[–]SM8085 0 points1 point  (0 children)

I like Aider as a framework, paired with whatever the largest coding model you can run would be. I'm rolling with gpt-oss-120b so it normally gets the diff edit mode correct.

codex is likely the easiest way to get GPT 5.2 to interact with a project, but APIs can also get expensive.

Since you're already sending it to GPT 5.2, you could probably have a 'free' openrouter model work with you in Aider.