Files
hermes-agent/persistence/sqlite/conversation
Ted Carnahan c8fb8f0bce fix(cron): bound and index the inbox listing
`_list` called `session_ids_with_model_config_key`, which scans every `sessions` row for the marker
and returns every match; only the per-row reads were capped at 200. The scan and the id transfer
grew with history, which is the unresolved half of the earlier review thread.

`recent_model_config_key_ids(key, limit)` is one query ordered by `started_at` with a LIMIT, through
a new partial index `idx_sessions_model_config_key_live` whose predicate is the marker. The same
predicate excludes a compressed root, so a rotated item appears once, at its tip.

EXPLAIN QUERY PLAN on the new schema reports
`SCAN sessions USING INDEX idx_sessions_model_config_key_live`.

Tests: a rotated item is listed once, at its child.
2026-11-30 02:25:20 -08:00
..