mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-05 02:07:34 +08:00
The previous implementation used `len(self._entries) > 1` to check if any sessions had ever been created. This failed for single-platform users because when sessions reset (via /reset, auto-reset, or gateway restart), the entry for the same session_key is replaced in _entries, not added. So len(_entries) stays at 1 for users who only use one platform. Fix: Query the SQLite database's session count instead. The database preserves historical session records (marked as ended), so session_count() correctly returns > 1 for returning users even after resets. This prevents the agent from reintroducing itself to returning users after every session reset. Fixes #351