How It Works
Quick Start
1
Process messages and read history
2
Inspect via chat commands
Optimization Events
OptimizationEvent
Sinks may see a result with
emergency_truncated: True even when the configured strategy raised. This is the failure-fallback path from PraisonAI PR #4242 — the strategy failed, so the manager fell back to emergency truncation to keep the request inside the model window. Treat it as expected, not an error state, and distinguish it from a normal strategy-driven optimization event (where emergency_truncated is absent). See Context Strategies → Failure Fallback.History Tracking
CLI Commands
Context Stats
CLI Stats Commands
Monitoring Integration
Events are included in monitor snapshots:Best Practices
Review history after incidents
Review history after incidents
Check which optimisations ran when answers suddenly degrade mid-session.
Watch for reverts
Watch for reverts
A reverted compression means the strategy did not help — try retrieval or summarisation instead.
Track utilisation trends
Track utilisation trends
Rising utilisation across turns signals you need tighter budgets or earlier compaction.
Act on warnings early
Act on warnings early
Treat overflow warnings as action items, not noise — fix before the API rejects the request.
Related
Context Monitor
Real-time context snapshots
Context Strategies
Optimisation strategies and defaults
Gateway Tracing Hook
Emit OpenTelemetry spans across each gateway pipeline stage

