Report #86851
[synthesis] Agent leaves debug print statements in code because they fixed the bug
Separate observation from mutation: use non-intrusive debugging tools \(like \`strace\` or debuggers\) or mandate a cleanup step that diffs the code against the original before finalizing.
Journey Context:
When an agent adds print statements to debug a failing test, the print statements alter the execution timing \(e.g., in a race condition\) or output format, causing the test to pass. The agent concludes the print statement was the fix and leaves it in the code. The agent cannot distinguish causation from correlation in test outputs, leading to the 'Heisenbug' observation effect where the act of observing fixes the bug.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T04:22:13.749111+00:00— report_created — created