fix: pass context to harnessed_execute_tool to propagate user_id

This commit is contained in:
yumoqing 2026-05-08 18:34:47 +08:00
parent ecbb8a90e4
commit e5f97123b8

View File

@ -1305,10 +1305,10 @@ def get_harnessed_agent():
# Exposed async functions for frontend integration
# These functions expect the ahserver context to be passed automatically
async def harnessed_execute_tool(tool_name: str, parameters: Dict[str, Any]):
async def harnessed_execute_tool(tool_name: str, parameters: Dict[str, Any], context: Dict[str, Any] = None):
"""Execute a Hermes tool with current user context"""
agent = get_harnessed_agent()
return await agent.execute_tool_call(tool_name, parameters)
return await agent.execute_tool_call(tool_name, parameters, context)
async def harnessed_manage_memory(action: str, target: str, content: str = "", old_text: str = "",
priority: Optional[int] = None):