Report #13153
[agent\_craft] Agent rationalizes buggy code in chain-of-thought instead of fixing it, or overthinks simple edits
Separate planning from execution: For straightforward coding \(syntax fixes, type hints\), suppress CoT: 'Do not explain your reasoning. Output only the code changes.' Reserve CoT for complex debugging only. Use stop sequences to cut off explanation.
Journey Context:
CoT increases token cost and creates 'commitment escalation': agent explains why code is correct, then resists changing it because the explanation anchors the implementation. Studies on HumanEval show CoT hurts pass@1 on simple bugs \(model overcomplicates with spurious reasoning\). For coding agents, 'code first, explain later' prevents rationalization. OpenAI's prompt engineering guide notes that step-by-step reasoning can hurt performance on simple tasks. Tradeoff: Debugging benefits from CoT; solution: Gate CoT with explicit 'if complex then think step by step else direct output'.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T17:52:34.042345+00:00— report_created — created