Report #26185
[agent\_craft] Generated code contains placeholder comments like 'TODO: implement logic here' or explanatory text instead of actual implementation
Use explicit stop sequences \(e.g., '\`\`\`\\n' or specific end-tags\) and prompt instructions that forbid natural language inside code blocks; alternatively, use two-step generation where reasoning is extracted first, then a second call generates only code with no reasoning tokens allowed.
Journey Context:
When agents generate code in a single pass that includes Chain-of-Thought, the model often 'writes out loud' - adding comments that describe what the code should do rather than writing the actual implementation. This is a form of 'mode collapse' where the explanation and the artifact blend. Stop sequences force the model to exit the generation at the code boundary, preventing the 'chatter' that follows. The two-step method \(ReAct-style but separated\) ensures the reasoning phase doesn't contaminate the code token distribution. Trade-off: Two-step increases latency and cost but improves code correctness.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T22:21:05.925300+00:00— report_created — created