fix(session_search): demote cron below interactive sessions in discover ranking - #53597
Merged
Merged
Conversation
…er ranking Cron jobs accumulate large volumes of repetitive vocabulary (recurring project names, dates, summaries) and out-number a user's interactive sessions. Under bare BM25 they dominate the top FTS rows, so discover's early-exit-at-N dedup collects only cron sessions and the user's own conversations never surface — "recall blindness" (#19434). - _order_for_recall() stable-sorts FTS rows so interactive sources rank above cron before lineage dedup; within each class BM25/recency order is preserved. Cron is demoted, not excluded, so it still surfaces when it is the only match. - raise discover scan limit 50 -> 300 so buried interactive matches are in hand for the demotion pass. Fixes the cron-flooding sub-bug of #19434. The split-brain sub-bug is covered by #52798; the child-session sub-bug is superseded by in-place compaction.
Contributor
🔎 Lint report:
|
pai-scaffolde
pushed a commit
to pai-scaffolde/hermes-agent
that referenced
this pull request
Jun 28, 2026
…er ranking (NousResearch#53597) Cron jobs accumulate large volumes of repetitive vocabulary (recurring project names, dates, summaries) and out-number a user's interactive sessions. Under bare BM25 they dominate the top FTS rows, so discover's early-exit-at-N dedup collects only cron sessions and the user's own conversations never surface — "recall blindness" (NousResearch#19434). - _order_for_recall() stable-sorts FTS rows so interactive sources rank above cron before lineage dedup; within each class BM25/recency order is preserved. Cron is demoted, not excluded, so it still surfaces when it is the only match. - raise discover scan limit 50 -> 300 so buried interactive matches are in hand for the demotion pass. Fixes the cron-flooding sub-bug of NousResearch#19434. The split-brain sub-bug is covered by NousResearch#52798; the child-session sub-bug is superseded by in-place compaction.
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…er ranking (NousResearch#53597) Cron jobs accumulate large volumes of repetitive vocabulary (recurring project names, dates, summaries) and out-number a user's interactive sessions. Under bare BM25 they dominate the top FTS rows, so discover's early-exit-at-N dedup collects only cron sessions and the user's own conversations never surface — "recall blindness" (NousResearch#19434). - _order_for_recall() stable-sorts FTS rows so interactive sources rank above cron before lineage dedup; within each class BM25/recency order is preserved. Cron is demoted, not excluded, so it still surfaces when it is the only match. - raise discover scan limit 50 -> 300 so buried interactive matches are in hand for the demotion pass. Fixes the cron-flooding sub-bug of NousResearch#19434. The split-brain sub-bug is covered by NousResearch#52798; the child-session sub-bug is superseded by in-place compaction.
habarmc1223-sudo
pushed a commit
to habarmc1223-sudo/hermes-agent-fluxmem
that referenced
this pull request
Jul 8, 2026
…er ranking (NousResearch#53597) Cron jobs accumulate large volumes of repetitive vocabulary (recurring project names, dates, summaries) and out-number a user's interactive sessions. Under bare BM25 they dominate the top FTS rows, so discover's early-exit-at-N dedup collects only cron sessions and the user's own conversations never surface — "recall blindness" (NousResearch#19434). - _order_for_recall() stable-sorts FTS rows so interactive sources rank above cron before lineage dedup; within each class BM25/recency order is preserved. Cron is demoted, not excluded, so it still surfaces when it is the only match. - raise discover scan limit 50 -> 300 so buried interactive matches are in hand for the demotion pass. Fixes the cron-flooding sub-bug of NousResearch#19434. The split-brain sub-bug is covered by NousResearch#52798; the child-session sub-bug is superseded by in-place compaction.
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
…er ranking (NousResearch#53597) Cron jobs accumulate large volumes of repetitive vocabulary (recurring project names, dates, summaries) and out-number a user's interactive sessions. Under bare BM25 they dominate the top FTS rows, so discover's early-exit-at-N dedup collects only cron sessions and the user's own conversations never surface — "recall blindness" (NousResearch#19434). - _order_for_recall() stable-sorts FTS rows so interactive sources rank above cron before lineage dedup; within each class BM25/recency order is preserved. Cron is demoted, not excluded, so it still surfaces when it is the only match. - raise discover scan limit 50 -> 300 so buried interactive matches are in hand for the demotion pass. Fixes the cron-flooding sub-bug of NousResearch#19434. The split-brain sub-bug is covered by NousResearch#52798; the child-session sub-bug is superseded by in-place compaction.
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
…er ranking (NousResearch#53597) Cron jobs accumulate large volumes of repetitive vocabulary (recurring project names, dates, summaries) and out-number a user's interactive sessions. Under bare BM25 they dominate the top FTS rows, so discover's early-exit-at-N dedup collects only cron sessions and the user's own conversations never surface — "recall blindness" (NousResearch#19434). - _order_for_recall() stable-sorts FTS rows so interactive sources rank above cron before lineage dedup; within each class BM25/recency order is preserved. Cron is demoted, not excluded, so it still surfaces when it is the only match. - raise discover scan limit 50 -> 300 so buried interactive matches are in hand for the demotion pass. Fixes the cron-flooding sub-bug of NousResearch#19434. The split-brain sub-bug is covered by NousResearch#52798; the child-session sub-bug is superseded by in-place compaction.
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
…er ranking (NousResearch#53597) Cron jobs accumulate large volumes of repetitive vocabulary (recurring project names, dates, summaries) and out-number a user's interactive sessions. Under bare BM25 they dominate the top FTS rows, so discover's early-exit-at-N dedup collects only cron sessions and the user's own conversations never surface — "recall blindness" (NousResearch#19434). - _order_for_recall() stable-sorts FTS rows so interactive sources rank above cron before lineage dedup; within each class BM25/recency order is preserved. Cron is demoted, not excluded, so it still surfaces when it is the only match. - raise discover scan limit 50 -> 300 so buried interactive matches are in hand for the demotion pass. Fixes the cron-flooding sub-bug of NousResearch#19434. The split-brain sub-bug is covered by NousResearch#52798; the child-session sub-bug is superseded by in-place compaction.
This was referenced Aug 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
session_searchdiscover now surfaces the user's own conversations even when cron jobs flood the FTS index — fixing the "recall blindness" sub-bug of #19434 where only cron sessions came back.Root cause: cron jobs accumulate large volumes of repetitive vocabulary (recurring project names, dates, summaries). Under bare BM25 their rows dominate the top FTS results, so discover's early-exit-at-N lineage dedup collected only cron sessions and the user's interactive sessions never made the cut.
Changes
tools/session_search_tool.py:_order_for_recall()stable-sorts FTS rows so interactive sources rank above cron before lineage dedup. Within each class BM25/recency order is preserved (Python's sort is stable). Cron is demoted, not excluded, so it still surfaces when it's the only match.tools/session_search_tool.py: raise discover scan limit 50 → 300 so interactive matches buried under a wall of cron rows are still in hand for the demotion pass.tests/tools/test_session_search.py: 3 new tests — interactive ranks above cron when both match, cron still reachable when it's the only match,_order_for_recallis stable within class.Validation
cronsessioncli/telegramsessionE2E verified against a real
state.db(12 cron sessions out-numbering one older interactive session → interactive ranks first, cron fills remaining slots).Scope
This addresses the cron-flooding sub-bug of #19434. The other audited items are already handled: the JSON/SQLite split-brain by #52798 (FTS write-corruption detect + repair + gateway preferring live cached history), and child-session hiding is superseded by in-place compaction (no parent/child fork → archived turns stay FTS-searchable on the same id).
Fixes #19434 (cron-flooding portion).
Infographic