Skip to content

prevent agent widget editing loops#6

Open
Eisenh wants to merge 3 commits intoagent0ai:mainfrom
Eisenh:main
Open

prevent agent widget editing loops#6
Eisenh wants to merge 3 commits intoagent0ai:mainfrom
Eisenh:main

Conversation

@Eisenh
Copy link
Copy Markdown

@Eisenh Eisenh commented Apr 21, 2026

Problem: agent (sonnet 4.7) entered endless loop making the same error trying to replace a couple of lines of code. It was convinced it knew what needed to be done but the edit always failed. Despited repeated attempts to get it back on track, only adding these rules to the local context finnaly stopped its hallucinations.
Fix: Adds a "patch error loop prevention" subsection to app/L0/_all/mod/_core/spaces/ext/skills/space-widgets/SKILL.md, placed between staged turns and examples:

`patch error loop prevention

  • After any patchWidget or renderWidget error, call readWidget on that widget before attempting another patch
  • Treat source as unseen unless readWidget succeeded in the current turn. Never infer line numbers from memory
  • If the same error repeats twice on the same widget, stop and call readWidget before retrying
  • If patchWidget fails with a syntax or reference error on a line you did not touch, the existing source is already broken — read first, then use renderWidget for a full rewrite
  • Never make more than 2 consecutive patches on the same widget without a readWidget in between`

Copilot AI and others added 3 commits April 21, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants