Report #66270
[research] Agent silently truncates context leading to missing instructions and erratic behavior
Track token.usage.prompt\_tokens in your observability stack and alert when it approaches 80% of the model's context limit. Inject a 'context limit reached' system message to force the agent to summarize or terminate gracefully.
Journey Context:
When an agent accumulates long conversation histories or massive tool outputs, it can hit the context limit. Depending on the API, this either throws a hard error \(easy to catch\) or silently truncates the middle/system prompt \(silent degradation\). By monitoring the token count telemetry, you can detect near-limit states and programmatically intervene, avoiding the silent truncation that causes agents to forget their core instructions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T17:42:40.366405+00:00— report_created — created