|
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>
|
|---|
|
|
| clients/terminal/api.py |
|---|
| clients/terminal/tui/tui_app.py |
|---|
| clients/terminal/tui/widgets/__init__.py |
|---|
| clients/terminal/tui/widgets/status_panel.py |
|---|
| clients/terminal/tui/widgets/todo_list.py 0 → 100644 |
|---|
| navi/api/routes/sessions.py |
|---|
| navi/core/agent.py |
|---|
| navi/core/events.py |
|---|
| navi/core/planning.py |
|---|
| navi/core/subagent_runner.py |
|---|
| navi/tools/_internal/base.py |
|---|
| navi/tools/todo.py |
|---|
| tests/clients/test_todo_list.py 0 → 100644 |
|---|
| tests/clients/test_tui_app.py |
|---|
| tests/integration/test_api_routes.py |
|---|
| tests/unit/core/test_agent.py |
|---|
| tests/unit/core/test_events.py |
|---|
| tests/unit/core/test_planning.py |
|---|
| tests/unit/tools/test_todo.py |
|---|