Isolate sub-agent todo + render live todo in TUI side panel
Phase 1 — sub-agent todo isolation (backend):
- Add current_todo_session_id ContextVar; subagent_runner scopes it to the
  sub-agent's ephemeral run id so its auto-populated plan and todo updates
  land in an isolated KV row instead of clobbering the parent session's todo
  (which the parent's goal-anchoring reads every iteration).
- todo._sid() and planning.set_tasks prefer current_todo_session_id; the
  parent run leaves it unset, so all existing todo consumers (anti-stall,
  goal anchor, get_progress_message) behave exactly as before.

Phase 2 — live todo in the TUI right column:
- TodoUpdated event + emit it from the agent loop after planning auto-populate
  and after each tool-execution turn.
- GET /sessions/{id}/todos reads the parent session's todo KV row (explicit
  user_id/session_id, optional injected kv).
- api.get_todos + TodoList/TodoPanel widgets: status-coloured markers
  (pending dim, in_progress accent+bold, done success, failed error, skipped
  dim), progress header, scrollable panel below the auto-height info block.
- Hybrid delivery: REST seeds the panel on attach/switch, todo_updated WS
  events update it live.

Sub-agent todos as nested sub-lists is deferred to a later phase.

Co-Authored-By: Claude <noreply@anthropic.com>
1 parent f895a2c commit 9784ce7c659302f5b7107afd5adb849f67e74653
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored 22 hours ago
Showing 19 changed files
View
clients/terminal/api.py
View
clients/terminal/tui/tui_app.py
View
clients/terminal/tui/widgets/__init__.py
View
clients/terminal/tui/widgets/status_panel.py
View
clients/terminal/tui/widgets/todo_list.py 0 → 100644
View
navi/api/routes/sessions.py
View
navi/core/agent.py
View
navi/core/events.py
View
navi/core/planning.py
View
navi/core/subagent_runner.py
View
navi/tools/_internal/base.py
View
navi/tools/todo.py
View
tests/clients/test_todo_list.py 0 → 100644
View
tests/clients/test_tui_app.py
View
tests/integration/test_api_routes.py
View
tests/unit/core/test_agent.py
View
tests/unit/core/test_events.py
View
tests/unit/core/test_planning.py
View
tests/unit/tools/test_todo.py