Report #71238
[agent\_craft] Agent repeats the same buggy code when asked to 'fix the error' or 'try again'
Use the Self-Refine protocol: First prompt: 'Generate \{code\} for \{task\}.' Then, in a separate turn \(or via reflection prompt\), ask: 'Review the above code for \{specific\_issue\}. List any issues found \(Issue 1: ...\). Then provide the corrected code.' Ensure the model outputs the critique before the new code to force cognitive dissonance resolution.
Journey Context:
Asking the model to 'fix it' in a single pass often results in regenerating from the same high-probability distribution that produced the bug initially \(the 'regeneration trap'\). Self-Refine separates the evaluation \(critic\) generation from the production \(refiner\) generation. By forcing the model to articulate the error \('Issue 1: The loop uses <= instead of <'\), it must confront the specific mistake before generating the fix, breaking the pattern of repetition. This mimics the 'rubber duck debugging' methodology where explaining the code reveals the error.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T02:09:18.391616+00:00— report_created — created