mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-07-18 05:30:21 +00:00
1165bd9ca2
get_state_db_session_messages() returned archived (active=0) rows that in-place compaction had marked inactive. WebUI reconciliation feeds this reader straight into the next model-facing context (reconciled_state_db_messages_for_session, prefer_context=True), so those archived rows got pulled back in — resurrecting pre-compaction history and making every later turn re-trigger compression. Now, WHEN the messages table exposes an `active` column, inactive rows are excluded by default (`AND (active IS NULL OR active != 0)` — NULL/legacy rows preserved), with an `include_inactive=True` escape hatch for explicit recovery/audit callers. Schemas without the column are unaffected (guarded by `'active' in available`). Contributor stage; ungated on arrival. Co-authored-by: ai-ag2026 <ai-ag2026@users.noreply.github.com>