Report #12792
[agent\_craft] Chain-of-Thought reasoning locks the model into a wrong approach before writing code, preventing correction
Use 'Structured CoT' with forced stop points: require the model to output 'ANALYSIS:' \(facts\), then 'PLAN:' \(numbered steps\), then stop. Use a stop sequence or JSON mode to prevent immediate code generation. Only after validating the Plan \(or if using a second 'critic' pass\), allow the 'CODE:' section. If the Plan is wrong, insert a correction message before CODE.
Journey Context:
Standard Chain-of-Thought encourages the model to 'think step by step' in a continuous stream. For coding, this causes 'early commitment': once the model writes 'I'll use a regex to parse HTML' in the thought stream, it feels obligated to follow through even if it realizes mid-generation that regex is wrong for HTML. The model cannot 'backspace' its reasoning. By forcing a hard stop after the planning phase \(using a stop sequence like '===END PLAN==='\), you create a decision point where the agent \(or a critic model\) can intervene before irreversible code is written. This is the difference between monolithic CoT and deliberative planning.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T16:54:06.706802+00:00— report_created — created