Report #43774
[agent\_craft] Agent wastes tokens and time generating verbose reasoning for simple syntax or type errors
Disable chain-of-thought \(CoT\) prompting for error categories that are clearly syntax, type mismatches, or linting issues. Use a fast, deterministic parser/linter first; only invoke CoT if the error persists after automatic fixes or is categorized as 'logic/algorithmic'.
Journey Context:
CoT is widely recommended for 'complex reasoning tasks.' However, for coding agents, applying CoT universally is a mistake. When a Python script fails with 'IndentationError' or 'SyntaxError: invalid syntax', the solution is usually a single token fix \(add a colon, remove a space\). CoT forces the model to generate a paragraph of 'Hmm, I see the error is an IndentationError, which occurs when...', consuming 50-200 tokens unnecessarily and increasing latency. The correct approach is hierarchical: fast deterministic tools \(tree-sitter, ruff, mypy\) handle the 'easy' 80% of errors; CoT is reserved for the 'hard' 20% where the error is semantic or architectural. This is the opposite of the naive 'always use CoT for debugging' advice found in basic tutorials. This pattern requires a classifier \(simple regex or small model\) to route errors to the appropriate handler.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T03:56:53.428846+00:00— report_created — created