Refactor profile tool config to explicit agent/subagent structure
Replaces the confusing mix of enabled_tools + mcp_servers + subagent_tools
with a single explicit structure:

    tools: {
      agent:   {native: [...], mcp: {server: [groups]}},
      subagent:{native: [...], mcp: {server: [groups]}}
    }

Why:
- Old fields mixed native and MCP names (mcp__server__tool) in one list,
  making it impossible to tell at a glance what a subagent actually gets.
- subagent_runner.py had 25 lines of runtime MCP filtering logic that
  was hard to follow and error-prone.

Changes:
- AgentProfile: add ToolConfig / ToolScopeConfig pydantic models,
  keep old fields (enabled_tools, mcp_servers, subagent_tools) for
  auto-migration via _migrate_tools validator.
- loader.py: read new "tools" key, auto-migrate legacy configs.
- agent.py: _tool_list now accepts ToolScopeConfig.
- subagent_runner.py: simplified — profile.get_subagent_tools() returns
  the exact scope, no runtime filtering needed.
- context_builder.py, list_tools.py, spawn_agent.py: updated to use
  profile.get_agent_tools() / get_subagent_tools().
- All 6 profile config.json files migrated to new schema.
- Secretary subagent now explicitly gets navi-web MCP tools for web search.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 9f89ed7 commit f5de3fbd43e7947292f05edca19937db3d50546b
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored on 21 May
Showing 13 changed files
View
navi/core/agent.py
View
navi/core/context_builder.py
View
navi/core/subagent_runner.py
View
navi/profiles/base.py
View
navi/profiles/developer/config.json
View
navi/profiles/discuss/config.json
View
navi/profiles/loader.py
View
navi/profiles/modeler_3d/config.json
View
navi/profiles/secretary/config.json
View
navi/profiles/server_admin/config.json
View
navi/profiles/tool_developer/config.json
View
navi/tools/list_tools.py
View
navi/tools/spawn_agent.py