diff --git a/navi/core/agent.py b/navi/core/agent.py index 842880d..2ecca9e 100644 --- a/navi/core/agent.py +++ b/navi/core/agent.py @@ -338,7 +338,12 @@ tool_schemas = [t.schema() for t in tools] llm = self._get_backend(profile.llm_backend) - mem = await self._ctx_builder._memory_msg(user_id=session.user_id) + user_id = None + if parent_session_id and self._sessions: + parent_session = await self._sessions.get(parent_session_id) + if parent_session: + user_id = parent_session.user_id + mem = await self._ctx_builder._memory_msg(user_id=user_id) # Build subagent system prompt — completely separate from the parent's system prompt. # No persona, no orchestrator instructions, no profiles block.