Step 4: Extract SubAgentRunner from run_ephemeral()
- Create navi/core/subagent_runner.py with full sub-agent loop logic
- Move _iter_stream_guarded to navi/core/stream_guard.py
- Move _check_context_size to ContextCompressor.check_context_size()
- Extract build_tool_list() and load_user_enabled_tools() to tool_utils.py
- Agent.run_ephemeral() becomes a thin wrapper delegating to SubAgentRunner
- Remove ~310 lines from agent.py
- All existing run_ephemeral tests pass unchanged

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 8bd25a7 commit 7ecf1b17200537761c19aaa40c558be02ba5edb7
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored on 16 May
Showing 6 changed files
View
navi/core/agent.py
View
navi/core/compressor.py
View
navi/core/stream_guard.py 0 → 100644
View
navi/core/subagent_runner.py 0 → 100644
View
navi/core/tool_utils.py 0 → 100644
View
tests/unit/core/test_agent_context_size.py