hermes-agent/gateway
Shakti Prasad Mohapatra 8e9702d227 fix: persist session hygiene compression cooldown to state DB
The session hygiene compression path tracked its per-session failure
cooldown in an in-memory dict (_hygiene_compression_failure_cooldowns).
When the gateway restarted, the dict was gone, so the next message
re-triggered the same failing compression, wedging session storage.

The state DB already has a persistent column
(sessions.compression_failure_cooldown_until) and full read/write/clear
methods (record_/get_/clear_compression_failure_cooldown in hermes_state.py)
used by the in-conversation compression path (context_compressor.py) but
not by the session hygiene path in gateway/run.py.

Fix: replace the in-memory dict with calls to the persistent DB methods:
- Cooldown check: use get_compression_failure_cooldown instead of dict lookup
- Timeout failure: use record_compression_failure_cooldown instead of dict write
- Abort failure: use record_compression_failure_cooldown instead of dict write

After a restart, a session whose compression is in cooldown is now skipped
for the cooldown's remaining duration rather than re-attempted immediately.

Fixes #74136
2026-07-31 23:16:58 -07:00
..
assets
…
builtin_hooks
…
platforms fix(yuanbao): await the forwarded-records loading heartbeat 2026-07-31 22:35:20 -07:00
relay
…
__init__.py
…
authz_mixin.py
…
cgroup_cleanup.py
…
channel_directory.py
…
code_skew.py
…
config.py
…
cwd_placeholder.py
…
dead_targets.py
…
delivery.py
…
delivery_ledger.py
…
display_config.py
…
drain_control.py
…
hooks.py
…
kanban_watchers.py fix(kanban): deliver notifications from non-dispatch gateways 2026-07-31 21:52:11 -07:00
lifecycle_ledger.py
…
memory_monitor.py
…
message_timestamps.py
…
mirror.py
…
pairing.py
…
platform_registry.py
…
profile_routing.py
…
readiness.py
…
response_filters.py
…
restart.py
…
restart_loop_guard.py
…
rich_sent_store.py
…
run.py fix: persist session hygiene compression cooldown to state DB 2026-07-31 23:16:58 -07:00
runtime_footer.py
…
scale_to_zero.py
…
session.py fix(gateway): scope session lists before limiting 2026-07-31 22:36:55 -07:00
session_context.py fix(delegation): prevent child HERMES_SESSION_ID leak into parent process env 2026-07-31 22:32:55 -07:00
session_state.py
…
shutdown_flush.py
…
shutdown_forensics.py
…
shutdown_watchdog.py
…
slash_access.py
…
slash_commands.py fix(gateway): offload preflight-compression warning enrichment; behavioral offload tests 2026-07-31 22:39:34 -07:00
status.py
…
status_phrases.py
…
sticker_cache.py
…
stream_consumer.py
…
stream_dispatch.py
…
stream_events.py
…
streaming_tts_consumer.py
…
systemd_notify.py
…
turn_context.py
…
turn_lease.py
…
wake.py
…
whatsapp_identity.py
…