Fix recall race, ContextVar leaks, dead code, and recall duplication
- run_recall: wrap busy check + create_run in session_lock to prevent
  race between scheduler and websocket handler
- run_recall: save ContextVar tokens and reset in finally to avoid
  leaking user context into subsequent background tasks
- websocket.py: reset user ContextVars in finally after run completes
- orchestrator.py: remove dead set_notify / _notify abstraction
- orchestrator.py: extract _finalize_recall to deduplicate success /
  MaxIterationsReached / Exception finalization blocks

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 15d9e6d commit 2f4632c8022e5fc424bc696df8019657ec7716a7
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored on 23 May
Showing 2 changed files
View
navi/api/websocket.py
View
navi/core/orchestrator.py