Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions plugins/memory/honcho/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,14 +626,15 @@ def get_prefetch_context(self, session_key: str, user_message: str | None = None
Pre-fetch user and AI peer context from Honcho.

Fetches peer_representation and peer_card for both peers, plus the
session summary when available. search_query is intentionally omitted
— it would only affect additional excerpts that this code does not
consume, and passing the raw message exposes conversation content in
server access logs.
session summary when available. When user_message is provided, it is
passed as search_query to the peer context call so Honcho returns
conclusions relevant to the session topic rather than the full
observation dump.

Args:
session_key: The session key to get context for.
user_message: Unused; kept for call-site compatibility.
user_message: Optional first user message used as search_query for
topic-relevant context retrieval.

Returns:
Dictionary with 'representation', 'card', 'ai_representation',
Expand All @@ -659,7 +660,7 @@ def get_prefetch_context(self, session_key: str, user_message: str | None = None
logger.debug("Failed to fetch session summary from Honcho: %s", e)

try:
user_ctx = self._fetch_peer_context(session.user_peer_id, target=session.user_peer_id)
user_ctx = self._fetch_peer_context(session.user_peer_id, search_query=user_message or None, target=session.user_peer_id)
result["representation"] = user_ctx["representation"]
result["card"] = "\n".join(user_ctx["card"])
except Exception as e:
Expand Down