Skip to content

fix(session-search): ignore FTS operators when centering excerpts#18690

Closed
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/session-search-fts-operators-4238
Closed

fix(session-search): ignore FTS operators when centering excerpts#18690
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/session-search-fts-operators-4238

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

Summary

  • exclude FTS5 boolean operators from transcript excerpt match terms
  • keep phrase matching intact while avoiding early OR/AND/NOT noise in long transcripts
  • add a regression covering OR-heavy queries that should center on real terms

Fixes #4238

Verification

  • scripts/run_tests.sh tests/tools/test_session_search.py::TestTruncateAroundMatches::test_fts5_boolean_operators_are_not_match_terms
  • scripts/run_tests.sh tests/tools/test_session_search.py
  • git diff --check origin/main...HEAD

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/tools Tool registry, model_tools, toolsets labels May 2, 2026
@teknium1

Copy link
Copy Markdown
Contributor

This looks implemented on current main by the later session_search redesign. Automated hermes-sweeper review.

Evidence:

  • PR fix(session-search): ignore FTS operators when centering excerpts #18690 fixes the old _truncate_around_matches() excerpt-centering helper by filtering FTS5 boolean operators before splitting query terms, but that helper/path is no longer present in the current tracked tools/session_search_tool.py / related session-search files.
  • Current discovery now calls db.search_messages(...) in tools/session_search_tool.py:405, then anchors the returned context with db.get_anchored_view(hit_sid, msg_id, ...) in tools/session_search_tool.py:453.
  • hermes_state.py:2526 implements get_anchored_view(...) on top of get_messages_around(session_id, around_message_id, ...), so the returned window is centered on the actual matched message id, not whitespace-split query terms such as OR.
  • The redesign landed in abf1af540193c30047ff3e7e759c330faf3a880f (feat(session_search): single-shape tool with discovery, scroll, browse — no LLM (#27590)), which is contained in v2026.5.28.
  • The linked issue Session search truncation treats FTS5 boolean operators as search terms #4238 was already closed with the same implementation evidence.

@teknium1 teknium1 closed this Jun 10, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tools Tool registry, model_tools, toolsets P2 Medium — degraded but workaround exists sweeper:implemented-on-main Sweeper: behavior already present on current main type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Session search truncation treats FTS5 boolean operators as search terms

3 participants