Files
hermes-agent/hermes_state.py
Hermes 2de42ba690 fix(state): add missing thread lock to session_count() and message_count()
Both methods accessed self._conn without self._lock, breaking the
thread-safety contract documented on SessionDB (line 111). All 22 other
DB methods use with self._lock — these two were the only exceptions.

In the gateway's multi-threaded environment (multiple platform reader
threads + single writer) this could cause cursor interleaving,
sqlite3.ProgrammingError, or inconsistent COUNT results.

Closes #2130
2026-03-22 04:38:17 -07:00

36 KiB