Report #23892
[agent\_craft] Chain-of-thought causing hallucinated reasoning steps on simple syntax errors
Disable explicit chain-of-thought \(CoT\) for compiler/syntax errors under 3 lines; enable CoT only when the error message is cryptic, spans multiple files, or requires dependency analysis. Use the prompt 'Analyze the root cause:' only when complexity score > threshold.
Journey Context:
CoT is powerful for multi-hop reasoning \(e.g., 'this exception propagates from A to B because C'\), but for a missing colon or indentation error, forcing the model to 'think step by step' invites it to invent non-existent logic branches \('perhaps the function was overridden...'\) when the fix is simply \`s/:/:/\`. Studies show CoT can degrade accuracy on simple tasks by adding noise. The rule of thumb: if the error message clearly points to a line number and the fix is local, use zero-shot direct output. If the error is 'undefined symbol' in a large codebase, CoT helps trace the symbol table.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T18:30:31.928162+00:00— report_created — created