Navi Code TUI: sub-agent spawn card + nested styling for subagent thinking/planning
Sub-agent activity was either rendered as a generic tool card (spawn_agent) or
dropped to raw debug output (turn_thinking was unhandled in the TUI chat model
and the raw CLI). The webclient nests subagent events inside the spawn_agent
card; the TUI is flat, so nesting is conveyed with a distinct spawn card plus
left-indented, dimmed subagent cards.

New renderers/subagent.py:
- SpawnAgentStartedRenderer: "↘ subagent · <profile_id>" card showing the task
  (+ briefing dimmed), secondary border. Registered before ToolStartedRenderer.
- SpawnAgentResultRenderer: "↙ subagent · <profile_id> ✓/✗" card with the
  result, success/error border. Registered before ToolResultRenderer.

Nested subagent styling (left indent via Padding + dim):
- ThinkingRenderer: is_subagent → "subagent thinking" title, dim border, indented.
- PlanningStatusRenderer / PlanReadyRenderer: is_subagent → indented (label/title
  already mark it as subagent).
- ToolStartedRenderer / ToolResultRenderer: is_subagent → indented so inner
  tool calls read as nested inside the spawn card.

chat_model handles turn_thinking → thinking_block item with is_subagent meta;
chat_panel._refresh forwards is_subagent to the thinking renderer. Raw CLI
render.py prints turn_thinking as a [thinking] block (with "(subagent)" prefix).

Tests: spawn card shows profile/task and status; subagent thinking/planning/tool
cards are indented and labeled; non-subagent tool card is not indented;
turn_thinking creates a subagent thinking_block. 593 passed, 1 skipped.

Co-Authored-By: Claude <noreply@anthropic.com>
1 parent dd1d9e1 commit ab176b7c3b27ddfb6e0bdb14ffbffc60a948f046
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored 1 day ago
Showing 11 changed files
View
clients/terminal/render.py
View
clients/terminal/tui/chat_model.py
View
clients/terminal/tui/renderers/__init__.py
View
clients/terminal/tui/renderers/planning.py
View
clients/terminal/tui/renderers/subagent.py 0 → 100644
View
clients/terminal/tui/renderers/thinking.py
View
clients/terminal/tui/renderers/tool.py
View
clients/terminal/tui/widgets/chat_panel.py
View
tests/clients/test_planning_renderers.py
View
tests/clients/test_subagent_renderers.py 0 → 100644
View
tests/clients/test_tui_app.py