Unify in-memory session state in AgentSessionOrchestrator
Replace scattered _runs + _busy_sessions + _session_sockets with a
single _sessions: dict[str, SessionState] on the orchestrator.

- SessionState dataclass holds run, busy_event, and websockets
- _session_sockets module-level global removed from websocket.py;
  socket tracking moved into orchestrator (add/remove_websocket)
- Event bus subscriber _on_recall_update moved into orchestrator
- Per-session asyncio.Lock added to protect concurrent-run guard
- _cleanup() auto-removes empty SessionState entries

Tests updated to reference _sessions instead of legacy _runs.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 3d182f6 commit 15d9e6db2821a950a6efa547baaccbad5f541233
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored on 23 May
Showing 5 changed files
View
docs/architecture_weak_spots.md
View
navi/api/websocket.py
View
navi/core/orchestrator.py
View
tests/integration/test_scheduler_loop.py
View
tests/unit/api/test_websocket.py