Ext · Cross-cutting
Context Overflow
Detects when agent context windows are approaching or exceeding capacity, causing information loss and degraded performance.
Examples
- Agent conversation has consumed 95% of the 128K token context window
- Per-turn token usage averaging 8K tokens with only 12K remaining
- System prompt + tool definitions consume 40% of available context
- Token usage trending upward with estimated overflow in 3 turns
Detection methods
- Token Counting
- Precise token counting using tiktoken per model
- Usage Tracking
- Monitors safe (<70%), warning (70-85%), critical (85-95%), overflow (>95%)
- Overflow Prediction
- Estimates turns until overflow based on per-turn averages
- Token Breakdown
- Separates system, message, and tool token usage
Calibration accuracy
F1
0.823
Precision
1.000
Recall
0.699
From the Pisama calibration set. See detector scoreboard for the full table.
Detect this in production with the framework adapters (LangGraph, CrewAI, AutoGen, OpenAI Agents SDK, Claude Agent SDK, n8n, Dify). See the full taxonomy at /taxonomy.