- • Emitted by Hermes Agent after each model response
- • Contains tokens_used and context_length for the session
- • Handled in use-streaming-message.ts SSE event loop
- • pct = tokens_used / context_length (0–1 float)
- • Map of sessionKey → contextPercent (0–100)
- • updateContextPercent() called per SSE event
- • Updates from non-active sessions are discarded
- • ContextRing subscribes and re-renders on each update
- • 35% — approaching agent auto-compact threshold (~40%)
- • 75% — context is getting full; consider new session
- • 90% — nearly exhausted; response quality may drop
- • Each alert fires once per session per calendar day (sessionStorage)