Repository navigation
fix(session-search): read anchored views through the storage interface on Hermes v0.23.3 - #34
Merged
xraysight merged 1 commit intoNov 21, 2026
Conversation
…e on Hermes v0.23.3 On Hermes v0.23.3 hermes_state.SessionDB is a compatibility class without get_anchored_view, so a source-filtered session search drops every hit. Where persistence_assembly imports, read the anchored view from the store and hand the store to the lineage lookup. Older Hermes keeps the old path. Tests: the load helper pins the old path, and one new test covers the new path with a fake store. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
xraysight
approved these changes
Nov 21, 2026
xraysight
left a comment
Owner
There was a problem hiding this comment.
Verified that this restores source-filtered session search on Hermes v0.23.3 for both default and named profiles. Unfiltered search and behavior on the older Hermes revision are unchanged. All 105 local tests passed. Thanks for catching and fixing this, @Bjorgz!
Owner
|
Hi @Bjorgz , thanks again and indeed I would appreciate another PR for the issue with parent id you mentioned if you find some time. |
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.
Problem
On Hermes v0.23.3 a memory search with a source filter returns no results.
_source_filtered_session_searchcallsSessionDB.get_anchored_view. In v0.23.3hermes_state.SessionDBis a compatibility class without that method, so each hit fails inside the loop, and the loop skips it. The module says that Hermes v0.27.0 removes it.Change (
dashboard/plugin_api.py, +39/−2)If
persistence_assemblyimports, the search opensopen_persistence_reader(profile_scope().profile_dir)and reads the anchored view withstore.messages.read_anchored_view, mapped to the dict shape of the old call. It also hands the store to_session_lineage_root, because v0.23.3's_resolve_to_parentwalks the lineage on the store. With the compatibilitySessionDBit finds no parent. If the import fails (older Hermes), the old path runs unchanged.Tests
Hermes
8783054ef6wrote a small database. I ran plugin v0.7.1, stock and patched, on that file under8783054ef6, and on a copy that v0.23.3 converted under v0.23.3. I drove the dashboard app through a test client and compared each answer with the answer of the stock file on8783054ef6.8783054ef678 of the 198 calls return results on
8783054ef6. On v0.23.3 the stock file returns no result for any of them. The 6 calls that still differ with the patch show the known limit below. The 32 calls without a source filter give the same answers in all runs.8783054ef6has nopersistence_assembly, so its row runs the old path.On
mainwith the versions ofci.yml(Python 3.12, pytest 9.1.1, pyyaml 6.0.3) the suite gives 102 passed and 2 skipped before the change, and 103 passed and 2 skipped with it. The 2 skipped tests need a Hermes host. This pull request changestests/test_plugin_api.pyin two places:load_plugin_apinow setspersistence_assemblytoNoneinsys.modules, as it does forhindsight_embed. Without that line, four source-search tests fail wherepersistence_assemblyis importable, because they fake onlyhermes_state.plugin_api.py.Known limit on v0.23.3
A
tool_callscell that holds one JSON object, not a list, comes back as the list of its key names. Hermes v0.23.3 builds each message record withtuple(...)of that cell (persistence/sqlite/conversation/messages.py), so the values are gone before the plugin sees the record. I ran the object shape only. From the code, a JSON string would come back as its characters, and a nonzero number ortruewould drop the hit. My own databases hold none of these shapes.Not changed
search_messagesandget_sessionstill go throughhermes_state. The v0.23.3 compatibility class has both. They need the store when v0.27.0 removes the module; a comment in the code says so.On both Hermes versions
_resolve_to_parentreturns the pair(root_id, has_compression_hop), and_session_lineage_rootreturns that pair unchanged. A result of a source-filtered search then has a nulltitle, and itsparent_session_idis a two-item list. The stock file gives the same output on8783054ef6, and this pull request keeps it. The two tests that fake_resolve_to_parent, the new one included, return a plain id. I can send a separate fix if you want one.I found and fixed this with an AI coding assistant (Claude). The tests ran on my own machines.
🤖 Generated with Claude Code