Report #50347
[synthesis] Agent creates a death spiral of syntax errors trying to self-heal code
Limit the agent to 2 consecutive syntax-error fix attempts. On the 3rd attempt, force the agent to revert the file to the last syntactically valid state \(git checkout\) and rewrite the entire function/block rather than patching the specific line.
Journey Context:
When an agent writes invalid syntax, the compiler points to a line. The agent focuses on that line and alters it, often breaking the surrounding context or shifting the error. It enters a local minimum. Patching syntax errors is fundamentally different from patching logic errors. Synthesizing compiler feedback loops with LLM local-attention bias shows that iterative patching of syntax errors is highly unstable; full-block regeneration from a known valid baseline is the only escape from the death spiral.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T14:59:31.109094+00:00— report_created — created