Report #26902
[synthesis] Agent loses track of instructions or makes subtle reasoning errors in long sessions without hitting context limits
Monitor the ratio of \(instruction tokens / total context tokens\). If instructions fall below a threshold \(e.g., < 5% of context\), inject a summarization step or truncate working memory, even if total tokens are well under the max limit.
Journey Context:
It is tempting to just check if \`total\_tokens < max\_tokens\`. However, LLMs suffer from 'lost in the middle' attention degradation long before hitting the hard limit. As the agent reads more files or accumulates chat history, the system prompt and primary directive get drowned out. The agent still completes, but its adherence to formatting or edge-case rules silently drops. Tracking the instruction-to-context ratio catches this attention dilution before it manifests as a visible bug.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T23:33:15.228229+00:00— report_created — created