Improve subagent system: isolated tools, custom prompts, context transfer, timeout
AgentProfile:
- New fields: subagent_tools, subagent_planning_enabled, subagent_system_prompt
- loader.py: loads subagent_tools/subagent_planning_enabled from config.json,
  reads optional subagent_system_prompt.txt per profile

Profiles:
- Each profile now has a dedicated subagent_tools list (focused subset, no admin tools)
- subagent_planning_enabled: false (configurable per profile)
- New subagent_system_prompt.txt per profile with executor-focused instructions

run_ephemeral:
- Uses profile.subagent_tools instead of enabled_tools
- Builds subagent context without persona or profiles block (focused executor)
- Injects subagent_system_prompt after profile.system_prompt
- Accepts context_transfer: priming exchange injected before task message
- Wall-clock timeout (default 5 min) checked per iteration
- Returns (result_text, completed: bool) instead of bare string
- Optionally runs planning phase if profile.subagent_planning_enabled

spawn_agent:
- Removed briefing param; task is now fully self-contained
- Added system_prompt param: custom injected prompt for this specific task
- Auto-reads parent scratchpad context_transfer section via get_section()
- Result prefixed with [STATUS: completed|limit_reached]
- Timeout 300s

scratchpad:
- Added get_section(session_id, section) helper for cross-session reads

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0c3dc98 commit 73cab8a8278be9e9bab65850939dae0bb11d2729
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored on 17 Apr
Showing 13 changed files
View
manuals/spawn_agent.md
View
navi/core/agent.py
View
navi/profiles/base.py
View
navi/profiles/developer/config.json
View
navi/profiles/developer/subagent_system_prompt.txt 0 → 100644
View
navi/profiles/loader.py
View
navi/profiles/secretary/config.json
View
navi/profiles/secretary/subagent_system_prompt.txt 0 → 100644
View
navi/profiles/server_admin/config.json
View
navi/profiles/server_admin/subagent_system_prompt.txt 0 → 100644
View
navi/tools/scratchpad.py
View
navi/tools/share_file.py
View
navi/tools/spawn_agent.py