Wednesday, July 8, 2026

Recent AI Work and Updates



 I have put my side scroller game on hold to work more generally on getting local models to work when trying to build larger projects.  Early on I was running into issue with local agents (Qwen3.6, Gemma4 etc.) and file edits.  They seemed to always fail.  I installed a plugin called snap-edits that has 2 tools called quick_edit and target_edit.  This seemed to help.  It allowed the agents to make more progress using smaller edits.

After a while, though, they seemed to get stuck in loops trying to edit files.  Those tools require matching exact text in the file to make an edit.  This seems to be an issue, maybe because of hallucination, or because the file content has changed and the agent was not re-reading before trying to make an edit.

After watching this for several days and trying several different setups and agents and still not making much progress I decided to try something else.  I had the agent build an extension for pi that has 2 new tools named delete_lines and insert_code.  The agent picked those names after I described what I wanted.  I don't like them especially because insert_code could work for anything, not just code, but I decided to keep them.  

I built them to be simple so the agent could use them without to much thinking.  Delete_lines just takes a file path, a start line and a number of lines and it deletes them.  Insert_code takes a file path, a start line and a block of code.  The other editing tools seemed to be too restrictive and too focused on not making mistakes.

These new tools have worked well.  The agents are able to get work done with them, but I had to give them a few more directions to get it working smoothly, or at least as smoothly as I could for now.  Here is what I put in the AGENTS.md file.

***Large File Writing Workflow***

insert_code (20-30 lines at most)
read file
if correct
  start back at insert_code
if incorrect
  delete_lines that were inserted
read file to make sure delete is correct
try again or rethink how to break up the insert
start back at insert_code

This seems to work well when the agents follow this workflow.  They seem to forget after a while and fall back to inserting code and not checking the file until they have made a mess.  I'm still working on trying to keep them focused and following directions.

I'll post again when I have tried this on a larger project.





No comments:

Post a Comment

Recent AI Work and Updates

 I have put my side scroller game on hold to work more generally on getting local models to work when trying to build larger projects.  Earl...