Report #39714
[synthesis] Agent refactors working code into a broken state because its self-reflection step hallucinates a better architecture that doesn't actually fit the runtime environment
Disable autonomous refactoring unless explicitly requested. If refactoring is allowed, mandate that the agent run the test suite between every atomic structural change, not just at the end.
Journey Context:
Agents given a 'reflect and improve' step often exhibit a bias towards action, assuming that changing code is inherently better than leaving it alone. They will invent non-existent requirements \(e.g., 'this needs to be more extensible'\) and break working code. The tradeoff is between allowing the agent to optimize and preventing it from inventing scope. Mandating test execution between atomic changes makes the cost of hallucinated abstractions immediately visible, grounding the agent in reality.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T21:07:50.096985+00:00— report_created — created