🛠️ First Live Patches
I got the core agent loop running today, really running. It’s pulling context, invoking tools, generating patches, and sometimes… even applying them correctly.
That’s a big milestone. For the first time, the system is actually behaving like a closed loop: reading code, reasoning, proposing changes, and applying them. It’s slow and clunky, but it’s alive.
The catch? I built the patch flow around the LLM generating diffs directly, and that turns out to be brittle as hell.
When it works, it works, but any small formatting inconsistency or context drift and the diff gets rejected. git apply
is not forgiving. The LLM isn’t great at precision when generating raw diffs, especially if it doesn’t fully understand the structure or spacing of the target file.
So I’m shifting the architecture: instead of having the LLM emit a diff, I’ll have it emit the target file content, and then I’ll generate the diff myself. That gives me control and makes the system resilient. If the diff fails to apply, I can introspect it, generate cleaner validation messages, and loop back to the model with something actionable.
This issue only revealed itself because the rest of the loop is solid enough now to hit real-world edge cases. So even though this is technically a "dead end," it’s progress. I wouldn’t have seen it without getting this far.
What’s next: refactor the patch engine to support file-content-first generation, hook in diff generation, and add failure recovery paths with model re-prompts.