UAT: TuiMaterializer not implemented — TUI has no real-time streaming output, live progress bars, or A2A event subscription #3666

Open
opened 2026-04-05 21:16:37 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/tui-materializer-streaming-a2a
  • Commit Message: fix(tui): implement TuiMaterializer with A2A event subscription and streaming output
  • Milestone: None (Backlog)
  • Parent Epic: #868

Backlog note: This issue was discovered during autonomous operation
on milestone v3.7.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.

Background and Context

The CleverAgents specification (TUI Architecture Overview and Output Rendering Framework sections, ADR-044, ADR-021, ADR-026) requires a TuiMaterializer that bridges the existing Output Rendering Framework to the Textual-based TUI. This materializer is the mechanism by which all CLI command producers can render in the TUI without modification — it maps ElementHandle events to Textual widget operations.

UAT testing of the TUI's real-time streaming output and A2A event integration revealed that TuiMaterializer does not exist in the codebase. Notably, src/cleveragents/tui/__pycache__/materializer.cpython-313.pyc exists, indicating a materializer.py source file was previously compiled but has since been deleted — this is a regression.

Current Behavior

  • No TuiMaterializer class exists anywhere under src/cleveragents/tui/ or its subdirectories.
  • The conversation panel in src/cleveragents/tui/app.py is a plain _Static widget (_Static("CleverAgents TUI", id="conversation")) that only supports update(text) — no streaming, no live updates.
  • The TUI has no A2A event subscription and does not connect to the A2A server at all.
  • When a slash command is executed, the result is a static string returned synchronously from TuiCommandRouter.handle() — no async streaming.
  • src/cleveragents/cli/output/materializers.py contains CLI materializers only; no TUI-specific materializer exists.
  • src/cleveragents/infrastructure/plugins/extension_protocols.py defines an OutputMaterializerExtension protocol but no TUI implementation exists.

Expected Behavior

Per the specification (ADR-044, ADR-021, ADR-026):

  1. A TuiMaterializer class exists in src/cleveragents/tui/materializer.py that maps ElementHandle events to Textual widget operations, enabling all CLI command producers to render in the TUI without modification.
  2. The TUI subscribes to A2A events for real-time updates (actor responses, tool calls, plan progress) — the TUI communicates with the Application layer exclusively through A2A.
  3. The conversation stream renders ActorResponse blocks with streaming Markdown (live updates as tokens arrive).
  4. ToolCall blocks show animated status (invoked → completed) with expandable content.
  5. PlanProgress blocks show a live-updating grid with status icons per step.
  6. Long-running commands use live-updating displays that redraw in place (not scrolling).
  7. Animated spinners with elapsed time and ETA are shown for progress indicators.

Acceptance Criteria

  • src/cleveragents/tui/materializer.py exists and contains a TuiMaterializer class implementing the OutputMaterializerExtension protocol.
  • TuiMaterializer maps ElementHandle events to Textual widget operations (reactive updates, not static update() calls).
  • The TUI subscribes to A2A events on startup and receives real-time actor responses, tool call results, and plan progress updates.
  • ActorResponse blocks stream Markdown tokens live as they arrive.
  • ToolCall blocks animate through invoked → completed states with expandable detail.
  • PlanProgress blocks render a live-updating grid with per-step status icons.
  • Long-running commands redraw in place (no scroll churn).
  • Animated spinners display elapsed time and ETA.
  • All new behaviour is covered by Behave BDD scenarios.

Supporting Information

  • Regression evidence: src/cleveragents/tui/__pycache__/materializer.cpython-313.pyc exists but src/cleveragents/tui/materializer.py is absent — the source was deleted.
  • Related ADRs: ADR-044 (TUI Architecture and Framework), ADR-021 (CLI and Output Rendering), ADR-026 (A2A communication boundary).
  • Parent Epic: #868 — TUI Interface, Modals and Persona System.
  • Affected files:
    • src/cleveragents/tui/app.py — conversation widget needs streaming capability
    • src/cleveragents/tui/materializer.py — must be recreated
    • src/cleveragents/cli/output/materializers.py — reference implementation for TUI variant
    • src/cleveragents/infrastructure/plugins/extension_protocols.pyOutputMaterializerExtension protocol to implement

Subtasks

  • Recreate src/cleveragents/tui/materializer.py with TuiMaterializer implementing OutputMaterializerExtension
  • Implement ElementHandle-to-Textual-widget mapping in TuiMaterializer
  • Replace _Static conversation widget in app.py with a streaming-capable Textual widget
  • Add A2A event subscription to the TUI application startup sequence
  • Implement ActorResponse streaming Markdown rendering (live token updates)
  • Implement ToolCall block with animated invoked → completed state transitions and expandable content
  • Implement PlanProgress block with live-updating grid and per-step status icons
  • Implement in-place redraw for long-running commands (no scroll churn)
  • Implement animated spinners with elapsed time and ETA
  • Tests (Behave): Add BDD scenarios for TuiMaterializer event mapping
  • Tests (Behave): Add BDD scenarios for A2A event subscription and streaming rendering
  • Tests (Behave): Add BDD scenarios for ToolCall and PlanProgress live updates
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • src/cleveragents/tui/materializer.py exists with a fully functional TuiMaterializer.
  • The TUI connects to A2A on startup and renders all output types (ActorResponse, ToolCall, PlanProgress) with live updates.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass.
  • Coverage >= 97%.

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-uat-tester

## Metadata - **Branch**: `fix/tui-materializer-streaming-a2a` - **Commit Message**: `fix(tui): implement TuiMaterializer with A2A event subscription and streaming output` - **Milestone**: None (Backlog) - **Parent Epic**: #868 > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.7.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. ## Background and Context The CleverAgents specification (TUI Architecture Overview and Output Rendering Framework sections, ADR-044, ADR-021, ADR-026) requires a `TuiMaterializer` that bridges the existing Output Rendering Framework to the Textual-based TUI. This materializer is the mechanism by which all CLI command producers can render in the TUI without modification — it maps `ElementHandle` events to Textual widget operations. UAT testing of the TUI's real-time streaming output and A2A event integration revealed that `TuiMaterializer` does not exist in the codebase. Notably, `src/cleveragents/tui/__pycache__/materializer.cpython-313.pyc` exists, indicating a `materializer.py` source file was previously compiled but has since been deleted — this is a **regression**. ## Current Behavior - No `TuiMaterializer` class exists anywhere under `src/cleveragents/tui/` or its subdirectories. - The conversation panel in `src/cleveragents/tui/app.py` is a plain `_Static` widget (`_Static("CleverAgents TUI", id="conversation")`) that only supports `update(text)` — no streaming, no live updates. - The TUI has no A2A event subscription and does not connect to the A2A server at all. - When a slash command is executed, the result is a static string returned synchronously from `TuiCommandRouter.handle()` — no async streaming. - `src/cleveragents/cli/output/materializers.py` contains CLI materializers only; no TUI-specific materializer exists. - `src/cleveragents/infrastructure/plugins/extension_protocols.py` defines an `OutputMaterializerExtension` protocol but no TUI implementation exists. ## Expected Behavior Per the specification (ADR-044, ADR-021, ADR-026): 1. A `TuiMaterializer` class exists in `src/cleveragents/tui/materializer.py` that maps `ElementHandle` events to Textual widget operations, enabling all CLI command producers to render in the TUI without modification. 2. The TUI subscribes to A2A events for real-time updates (actor responses, tool calls, plan progress) — the TUI communicates with the Application layer exclusively through A2A. 3. The conversation stream renders `ActorResponse` blocks with streaming Markdown (live updates as tokens arrive). 4. `ToolCall` blocks show animated status (invoked → completed) with expandable content. 5. `PlanProgress` blocks show a live-updating grid with status icons per step. 6. Long-running commands use live-updating displays that redraw in place (not scrolling). 7. Animated spinners with elapsed time and ETA are shown for progress indicators. ## Acceptance Criteria - `src/cleveragents/tui/materializer.py` exists and contains a `TuiMaterializer` class implementing the `OutputMaterializerExtension` protocol. - `TuiMaterializer` maps `ElementHandle` events to Textual widget operations (reactive updates, not static `update()` calls). - The TUI subscribes to A2A events on startup and receives real-time actor responses, tool call results, and plan progress updates. - `ActorResponse` blocks stream Markdown tokens live as they arrive. - `ToolCall` blocks animate through `invoked → completed` states with expandable detail. - `PlanProgress` blocks render a live-updating grid with per-step status icons. - Long-running commands redraw in place (no scroll churn). - Animated spinners display elapsed time and ETA. - All new behaviour is covered by Behave BDD scenarios. ## Supporting Information - **Regression evidence**: `src/cleveragents/tui/__pycache__/materializer.cpython-313.pyc` exists but `src/cleveragents/tui/materializer.py` is absent — the source was deleted. - **Related ADRs**: ADR-044 (TUI Architecture and Framework), ADR-021 (CLI and Output Rendering), ADR-026 (A2A communication boundary). - **Parent Epic**: #868 — TUI Interface, Modals and Persona System. - **Affected files**: - `src/cleveragents/tui/app.py` — conversation widget needs streaming capability - `src/cleveragents/tui/materializer.py` — must be recreated - `src/cleveragents/cli/output/materializers.py` — reference implementation for TUI variant - `src/cleveragents/infrastructure/plugins/extension_protocols.py` — `OutputMaterializerExtension` protocol to implement ## Subtasks - [ ] Recreate `src/cleveragents/tui/materializer.py` with `TuiMaterializer` implementing `OutputMaterializerExtension` - [ ] Implement `ElementHandle`-to-Textual-widget mapping in `TuiMaterializer` - [ ] Replace `_Static` conversation widget in `app.py` with a streaming-capable Textual widget - [ ] Add A2A event subscription to the TUI application startup sequence - [ ] Implement `ActorResponse` streaming Markdown rendering (live token updates) - [ ] Implement `ToolCall` block with animated `invoked → completed` state transitions and expandable content - [ ] Implement `PlanProgress` block with live-updating grid and per-step status icons - [ ] Implement in-place redraw for long-running commands (no scroll churn) - [ ] Implement animated spinners with elapsed time and ETA - [ ] Tests (Behave): Add BDD scenarios for TuiMaterializer event mapping - [ ] Tests (Behave): Add BDD scenarios for A2A event subscription and streaming rendering - [ ] Tests (Behave): Add BDD scenarios for ToolCall and PlanProgress live updates - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - `src/cleveragents/tui/materializer.py` exists with a fully functional `TuiMaterializer`. - The TUI connects to A2A on startup and renders all output types (ActorResponse, ToolCall, PlanProgress) with live updates. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass. - Coverage >= 97%. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
freemo added this to the v3.7.0 milestone 2026-04-05 21:19:00 +00:00
freemo removed this from the v3.7.0 milestone 2026-04-06 23:31:49 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
Reference
cleveragents/cleveragents-core#3666
No description provided.