mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-26 01:01:40 +00:00
The gateway had a SEPARATE compression system ('session hygiene')
with hardcoded thresholds (100k tokens / 200 messages) that were
completely disconnected from the model's context length and the
user's compression config in config.yaml. This caused premature
auto-compression on Telegram/Discord — triggering at ~60k tokens
(from the 200-message threshold) or inconsistent token counts.
Changes:
- Gateway hygiene now reads model name from config.yaml and uses
get_model_context_length() to derive the actual context limit
- Compression threshold comes from compression.threshold in
config.yaml (default 0.85), same as the agent's ContextCompressor
- Removed the message-count-based trigger (was redundant and caused
false positives in tool-heavy sessions)
- Removed the undocumented session_hygiene config section — the
standard compression.* config now controls everything
- Env var overrides (CONTEXT_COMPRESSION_THRESHOLD,
CONTEXT_COMPRESSION_ENABLED) are respected
- Warn threshold is now 95% of model context (was hardcoded 200k)
- Updated tests to verify model-aware thresholds, scaling across
models, and that message count alone no longer triggers compression
For claude-opus-4.6 (200k context) at 85% threshold: gateway
hygiene now triggers at 170k tokens instead of the old 100k.
|
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_async_memory_flush.py | ||
| test_channel_directory.py | ||
| test_config.py | ||
| test_delivery.py | ||
| test_document_cache.py | ||
| test_homeassistant.py | ||
| test_hooks.py | ||
| test_media_extraction.py | ||
| test_mirror.py | ||
| test_pairing.py | ||
| test_platform_base.py | ||
| test_resume_command.py | ||
| test_send_image_file.py | ||
| test_session.py | ||
| test_session_hygiene.py | ||
| test_signal.py | ||
| test_sticker_cache.py | ||
| test_telegram_documents.py | ||
| test_telegram_format.py | ||
| test_title_command.py | ||
| test_transcript_offset.py | ||
| test_update_command.py | ||
| test_whatsapp_connect.py | ||