Add spawn_agent: sub-agent delegation with isolated context
- Agent.run_ephemeral() — runs a sub-agent loop without a persistent
  session; accepts exclude_tools to block recursion; logs start/complete
- session_store made Optional in Agent.__init__ (None for ephemeral runs)
- SpawnAgentTool (navi/tools/spawn_agent.py): spawns an isolated Agent
  for a focused task; resolves profile from parent session via ContextVar;
  blocks spawn_agent recursion via exclude_tools=["spawn_agent"]
- build_default_registries() accepts session_store param; registers
  SpawnAgentTool after BackendRegistry is built (patches _backend_registry)
- deps.py passes _session_store to build_default_registries
- All profiles: spawn_agent added to enabled_tools, max_iterations 10→30
- persona.txt: DELEGATION section — when/how to use spawn_agent

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b190a4b commit 2efec3712d2d2bd1a8da62bfeb7e7a9045cf188e
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored on 9 Apr
Showing 9 changed files
View
navi/api/deps.py
View
navi/core/agent.py
View
navi/core/registry.py
View
navi/profiles/secretary.py
View
navi/profiles/server_admin.py
View
navi/profiles/smart_home.py
View
navi/tools/__init__.py
View
navi/tools/spawn_agent.py 0 → 100644
View
persona.txt