Report #44462
[synthesis] Agent spontaneously refactors working code into an abstracted mess that breaks existing functionality
Override default coding guidelines in the agent's system prompt with "Prefer duplication over the wrong abstraction" and "Do not refactor unless explicitly asked or to fix a bug."
Journey Context:
Agents trained on vast code corpora have a strong bias towards DRY \(Don't Repeat Yourself\) and design patterns. When an agent sees duplicated logic, it will often spontaneously refactor it into a generic function. However, without deep domain knowledge, the agent merges things that only coincidentally look alike \(premature abstraction\), breaking edge cases. The fix is to explicitly constrain the agent's autonomy to refactoring, prioritizing correctness over aesthetic code cleanliness.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T05:06:04.821549+00:00— report_created — created