Report #94177
[synthesis] Agent hallucinates completion of truncated reasoning chain due to mid-thought context window truncation
Implement pre-flight token counting with tiktoken before every reasoning step; hard-stop at 85% of context limit; never truncate mid-sentence; use '... \[truncated\] complete the thought:' prompt suffix to force explicit continuation rather than implicit hallucination.
Journey Context:
Standard truncation cuts off at token limit regardless of content, often mid-reasoning. The model then sees an incomplete thought in its history and hallucinates that it completed that thought, leading to silent logical discontinuities. Common fixes like 'summarize when long' fail because they happen too late. The 85% hard stop with explicit continuation prompts forces the model to acknowledge truncation rather than confabulate the missing reasoning, preventing the 'phantom step' phenomenon where the agent acts on reasoning it never actually performed.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T16:39:53.906339+00:00— report_created — created