Planning phases, context compression, and tool improvements
Agent:
- Planning now a 3-phase async generator: Analysis → Execution plan → AIHelper critic
- Yield PlanningStatus events before each phase (UI progress labels)
- Phase 1 runs with think=True for deeper analysis
- Phase 2 includes available tool list so executor assignments are accurate
- Phase 3: independent critic pass validates and corrects TOOL: names against real tool list
- Planning converted from list return to async generator (fixes token accounting)

Backend:
- Context compression threshold: 80% → 70% to trigger earlier
- Compressor summary prompt: structured sections (goal, work state, key facts, outputs, errors)
- Terminal output capped at 5000 chars to prevent context flooding
- Web search: region=wt-wt for DDG, country=ALL for Brave, language=all for SearxNG
- Scratchpad: mandate writing a 'goal' section at start of multi-step tasks
- secretary max_iterations: 40→25, temperature: 0.7→0.5
- server_admin max_iterations: 40→20

Webclient:
- ThinkingCard strips <thought> XML tags leaked by Ollama
- planning_status WS event wired to chat.onPlanningStatus()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0b5aeb4 commit 0c3dc98eb04422f3728b4d8417968a08d7476ca4
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored on 17 Apr
Showing 12 changed files
View
navi/api/websocket.py
View
navi/config.py
View
navi/core/agent.py
View
navi/core/compressor.py
View
navi/core/events.py
View
navi/profiles/secretary/config.json
View
navi/profiles/server_admin/config.json
View
navi/tools/scratchpad.py
View
navi/tools/terminal.py
View
navi/tools/web_search.py
View
webclient/src/components/messages/ThinkingCard.vue
View
webclient/src/composables/useWebSocket.js