mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-18 04:41:56 +00:00
fix: make session search initialize session db
This commit is contained in:
parent
9c26297c80
commit
840ebe063e
8 changed files with 220 additions and 11 deletions
|
|
@ -337,8 +337,14 @@ def session_search(
|
|||
The current session is excluded from results since the agent already has that context.
|
||||
"""
|
||||
if db is None:
|
||||
from hermes_state import format_session_db_unavailable
|
||||
return tool_error(format_session_db_unavailable(), success=False)
|
||||
try:
|
||||
from hermes_state import SessionDB
|
||||
|
||||
db = SessionDB()
|
||||
except Exception:
|
||||
logging.debug("SessionDB unavailable for session_search", exc_info=True)
|
||||
from hermes_state import format_session_db_unavailable
|
||||
return tool_error(format_session_db_unavailable(), success=False)
|
||||
|
||||
# Defensive: models (especially open-source) may send non-int limit values
|
||||
# (None when JSON null, string "int", or even a type object). Coerce to a
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue