Report #77430
[frontier] Agents crash or lose critical state when hitting context window limits during long-running tasks
Implement a circuit breaker that monitors token velocity \(tokens/step\) and triggers graceful summarization or checkpointing when projected window exhaustion < 3 steps away
Journey Context:
Naive agents accumulate message history until they hit a hard limit and throw, losing all in-flight progress. Leading teams now implement 'context circuit breakers' inspired by microservices resilience patterns. The agent tracks token velocity and, when the window is 20% from full, triggers a 'compression event' that summarizes older messages into a 'memory packet' or persists to external store. This requires careful handling of system messages that must survive compression. Alternative: naive truncation loses critical few-shot examples; compression preserves semantic content.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T12:34:07.489807+00:00— report_created — created