mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-26 17:38:36 +00:00
_resolve_user_name() caches every resolved (team_id, user_id) → display name but never evicts entries. On a long-running bot in a large workspace every unique user the bot encounters adds a permanent entry. Sibling structures _bot_message_ts (BOT_TS_MAX=5000) and _assistant_threads (ASSISTANT_THREADS_MAX=5000) already have caps; _user_name_cache had none. Fix: add _USER_NAME_CACHE_MAX = 5000 and evict the oldest half on overflow after each write, matching the existing sibling pattern. Consolidates the two cache-write branches (success + API error) into a single write so eviction runs once per resolution. Reapplied from #23676 onto the current adapter (cache moved to plugins/platforms/slack/adapter.py and is now keyed by (team_id, user_id) tuples for multi-workspace safety). |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| adapter.py | ||
| block_kit.py | ||
| plugin.yaml | ||