fix: ensure user_id is passed in context to harnessed_agent tools

This commit is contained in:
yumoqing 2026-05-08 18:03:44 +08:00
parent 518f174926
commit 564084f3c8
2 changed files with 2 additions and 1 deletions

Binary file not shown.

View File

@ -162,7 +162,7 @@ class HermesReasoningEngine:
async def _get_memory_context(self, user_id: str, request: str, config: Dict) -> Dict[str, Any]:
"""Get real memory and session context from harnessed_agent."""
context = {"memory_entries": [], "recent_sessions": [], "skills": []}
context = {"user_id": user_id, "memory_entries": [], "recent_sessions": [], "skills": []}
try:
# Intelligent memory
@ -453,6 +453,7 @@ class HermesReasoningEngine:
# Step 1: Gather real context
info(f"Reasoning start: user={user_id}, request={request[:80]}...")
context = await self._get_memory_context(user_id, request, config)
context['user_id'] = user_id # Ensure user_id is available for tool execution
# Step 2: LLM-based planning
plan = await self._generate_plan(request, context, config)