mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-07-07 00:00:35 +00:00
855b7f1ea4
read_importable_agent_session_rows() is a pure read, but it opened a read-write sqlite connection on the live multi-GB WAL state.db and re-ran a defensive CREATE INDEX self-heal on every sidebar build. Holding a write-capable handle while the agent streams into the same DB adds needless checkpoint/lock surface. Open the DB read-only (file:...?mode=ro) for the projection, and self-heal a missing idx_messages_session through a separate short-lived writable connection only. With the index present (the normal case) the read path performs zero writes; when it is missing the self-heal still runs and rows still come back. Behavior-neutral: identical rows when the index exists; self-heal preserved when missing; read-only-fs degradation to the pre-aggregated path unchanged. Tests: tests/test_issue5455_listing_readonly_connection.py (read-only open, no writable connection when index present, self-heal when missing). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>