Summary
session_search can return an empty successful result even when full-text search already found matching sessions.
The current flow appears to be:
- FTS finds candidate sessions in
state.db
session_search prepares those sessions for summarization
- auxiliary summarization fails
- each failed summary is dropped
- the tool returns
success: true, results: []
This makes a summarization/auth/runtime failure look like "no matching sessions found", which is a false negative.
Reported by Hermes Agent.
Verified behavior
- Matching sessions were present in
state.db
- direct FTS queries against
messages_fts returned hits for the search term
db.search_messages(...) returned matching messages and candidate sessions
tools.session_search_tool.session_search(...) still returned results: []
- candidate sessions were collected (
sessions_searched > 0)
_summarize_session() returned None for all candidates after auxiliary call failures
Expected behavior
If FTS found matching sessions, session_search should not return an empty successful result that is indistinguishable from a true "no matches" outcome.
Actual behavior
When summarization fails for all candidate sessions, session_search returns something like:
success: true
results: []
count: 0
This incorrectly suggests that nothing matched.
Why this is problematic
Search hit detection and summary generation are two separate stages.
A failure in stage 2 should not be reported as if stage 1 found nothing.
Suggested fix
At minimum, do not silently collapse summarization failure into an empty success result.
Reasonable options:
- Return a partial result with raw fallback data when summaries fail, such as:
session_id
- timestamp
- source
- snippet / preview
- Return an explicit error or partial-failure status when matches were found but summarization failed
- Treat
sessions_searched > 0 && results == [] as an abnormal state, not a normal no-match result
Likely relevant code paths
tools/session_search_tool.py
session_search()
_summarize_session()
hermes_state.py
Summary
session_searchcan return an empty successful result even when full-text search already found matching sessions.The current flow appears to be:
state.dbsession_searchprepares those sessions for summarizationsuccess: true, results: []This makes a summarization/auth/runtime failure look like "no matching sessions found", which is a false negative.
Reported by Hermes Agent.
Verified behavior
state.dbmessages_ftsreturned hits for the search termdb.search_messages(...)returned matching messages and candidate sessionstools.session_search_tool.session_search(...)still returnedresults: []sessions_searched > 0)_summarize_session()returnedNonefor all candidates after auxiliary call failuresExpected behavior
If FTS found matching sessions,
session_searchshould not return an empty successful result that is indistinguishable from a true "no matches" outcome.Actual behavior
When summarization fails for all candidate sessions,
session_searchreturns something like:success: trueresults: []count: 0This incorrectly suggests that nothing matched.
Why this is problematic
Search hit detection and summary generation are two separate stages.
A failure in stage 2 should not be reported as if stage 1 found nothing.
Suggested fix
At minimum, do not silently collapse summarization failure into an empty success result.
Reasonable options:
session_idsessions_searched > 0 && results == []as an abnormal state, not a normal no-match resultLikely relevant code paths
tools/session_search_tool.pysession_search()_summarize_session()hermes_state.pysearch_messages()