Report #46616
[synthesis] Agent enters infinite loop of 'improvements' during refactoring, never stopping or testing
Mandate a 'Test-Driven Refactoring' loop: Run tests -> Make ONE change -> Run tests. If tests pass, commit. If no more changes are obvious from the test output, stop. Define a strict 'max edits without test run' limit.
Journey Context:
Single sources discuss infinite loops or refactoring. The synthesis reveals that open-ended tasks lack a 'stopping criterion'. Without a feedback loop \(tests\), the agent relies on its own internal judgment of 'done', which is biased towards 'I can always make it better'. The fix is to bind the agent's stopping condition to an external, objective signal \(test pass\), not its internal satisfaction.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:43:03.685004+00:00— report_created — created