perf(state): cover role-sensitive message aggregates - #73654
perf(state): cover role-sensitive message aggregates#73654stefanpieter wants to merge 3 commits into
Conversation
|
Current-main conflict remediation is pushed at
Verification on the pushed tree:
The base advanced again only in six non-overlapping paths after validation; Fresh maintainer review is requested on this exact SHA. |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused schema and regression coverage. The DDL is correctly placed in the shared bootstrap: hermes_state_schema.py:308 executes SCHEMA_SQL, and the PR's hermes_state_common.py:286 addition would therefore reach fresh and reopened databases.
Problems
- This is a permanent index on every Hermes
state.db, but current-tree searches find no Hermes-owned role-sensitive aggregate consumer. The linked WebUI report identifies the expensive work as aggregating all sessions before slicing and recommends bounding the WebUI query plus improving cache invalidation instead: nesquena/hermes-webui#2628 (comment).
Suggested changes
- Please establish that this index remains needed after the WebUI query/cache remediation, or document a Hermes-owned caller that requires it, before adding its global storage and write-maintenance cost.
Automated hermes-sweeper review.
| CREATE INDEX IF NOT EXISTS idx_sessions_parent ON sessions(parent_session_id); | ||
| CREATE INDEX IF NOT EXISTS idx_sessions_started ON sessions(started_at DESC); | ||
| CREATE INDEX IF NOT EXISTS idx_messages_session ON messages(session_id, timestamp); | ||
| CREATE INDEX IF NOT EXISTS idx_messages_session_timestamp_role |
There was a problem hiding this comment.
This adds a permanent index to every state database, but the cited consumer is external WebUI code and no equivalent aggregate exists in this repository. Please establish that the WebUI query/cache remediation cannot remove the need for this global write/storage cost.
|
Resolved the current review blocker on exact head
Verification:
@teknium1 please resolve the historical thread or otherwise disposition this now-empty PR when available. No merge or close action was taken by this remediation run. |
|
Closing this as the branch now contains no diff against the base (0 files changed, 0 additions) — the covering index was intentionally reverted after the review concluded the role-sensitive aggregate is a WebUI-owned concern rather than an Agent-owned one. Thanks for following through on the review outcome and cleanly withdrawing the change. If a future Agent-side consumer materializes, a fresh PR would be welcome. |
Review remediation: implementation withdrawn
The current branch intentionally contains no feature diff against the reviewed base. The review correctly established that the proposed permanent Agent-side covering index was not justified by an Agent-owned consumer.
d369b64c7f39c72fb16a205d2db127bf2956ad63c55159f185e0c4a18f4fdaacb666f77d39d10623d369b64c7(fix(state): remove unneeded role aggregate index)Resolution
idx_messages_session_timestamp_roleand preserved the establishedidx_messages_session ON messages(session_id, timestamp)schema.LOWER(m.role)/ role-sensitive aggregate consumer.Verification
py_compile, Ruff,git diff --check: passed.ab25d2be…d369b64c7andc55159f…d369b64c7: PASS, no security or logic findings.MERGEABLE; the exact-head upstream workflow isaction_requiredpending repository-admin approval: https://github.com/NousResearch/hermes-agent/actions/runs/30621960491No merge or close action was taken. Maintainer/reviewer disposition of the now-empty PR and its unresolved historical thread remains external.