fix(memory): sanitize holographic fact_store FTS queries#14033
Open
LeonSGP43 wants to merge 1 commit into
Open
fix(memory): sanitize holographic fact_store FTS queries#14033LeonSGP43 wants to merge 1 commit into
LeonSGP43 wants to merge 1 commit into
Conversation
Collaborator
1 similar comment
Collaborator
This was referenced Apr 23, 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
fact_store(action="search")FTS5 queries before they reachMATCHpve-01stop triggering SQLite parse errorsProblem
The holographic memory provider passed raw user queries directly into
facts_fts MATCH ?.For hyphenated identifiers such as
pve-01, SQLite FTS5 parses the hyphen as query syntax and raises:In practice this broke fact retrieval in two ways:
MemoryStore.search_facts()raised immediatelyFactRetriever.search()swallowed the FTS error and returned an empty result set, making the failure look like a simple missFix
This PR adds a small
_sanitize_fts5_query()helper in the holographic store and uses it in both FTS entry points:MemoryStore.search_facts()FactRetriever._fts_candidates()The sanitizer mirrors Hermes' existing
SessionDBFTS5 handling:That keeps holographic memory search aligned with the project's existing transcript-search behavior while fixing the concrete
pve-01regression from #14024.Tests
pytest -o addopts="" tests/plugins/memory/test_holographic_provider.pyManual verification
Both now return the stored
PVE-01 ...fact instead of raising / silently returning[].Closes #14024