UAT: TUI notification system (Flash bar) not connected to A2A events — plan completion, errors, and session messages never trigger notifications #3339

Open
opened 2026-04-05 10:14:13 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/m8-tui-flash-a2a-event-subscription
  • Commit Message: fix(tui): connect Flash bar and conversation widgets to A2A event subscriptions
  • Milestone: None (Backlog — see note below)
  • Parent Epic: #868

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

Background and Context

Per ADR-044 (TUI Architecture and Framework), the TUI subscribes to A2A events for real-time notifications and conversation streaming. The Flash notification bar (height: 1) is specified to auto-dismiss after a configurable timeout and display semantic styling ($warning for errors, $success for completions). This was inspected in PR #1302 (branch: feature/m8-tui-mainscreen) at src/cleveragents/tui/screens/main_screen.py.

Current Behavior

In PR #1302 (feature/m8-tui-mainscreen):

  1. The Flash bar (_show_flash() method) exists but is only called from:
    • action_new_session() stub
    • action_close_session() stub
    • handle_ctrl_c() double-tap quit warning
  2. No A2A event subscription exists anywhere in the TUI codebase.
  3. plan.apply_completed, plan.error, session.message, tool.invoked, tool.completed events are never subscribed to.
  4. The Flash bar uses a single CSS class (-visible) with $warning color — no semantic styling for different notification types (success vs error vs info).
  5. No A2AClient is injected into MainScreen or any TUI widget.

Code Location:

  • src/cleveragents/tui/screens/main_screen.py (branch: feature/m8-tui-mainscreen)
    • _show_flash(): exists but not connected to A2A events
    • No A2AClient reference or event subscription
  • src/cleveragents/tui/ — no a2a_client.py, no event_handler.py, no subscription setup

Expected Behavior

Per ADR-044, the TUI subscribes to A2A events for real-time notifications:

Event TUI Action
plan.apply_completed Flash: show completion notification ($success styling)
plan.error Flash: show error notification ($error styling); SideBar: mark plan as errored
session.message Conversation: stream ActorResponse content
tool.invoked Conversation: mount ToolCall widget (pending state)
tool.completed Conversation: update ToolCall widget (done/fail state)
plan.phase_changed SideBar.PlansPanel: update phase indicator
plan.state_changed SideBar.PlansPanel: update state badge

The Flash bar should auto-dismiss after a configurable timeout (default: 3 s) and support semantic CSS classes: -success, -error, -warning, -info.

Steps to Reproduce

  1. Checkout branch feature/m8-tui-mainscreen
  2. Inspect src/cleveragents/tui/screens/main_screen.py
  3. Search for A2A event subscription code — none exists
  4. Run a plan that completes or errors
  5. Expected: Flash notification appears; Actual: no notification

Impact

The TUI provides no real-time feedback on plan execution, tool invocations, or actor responses. Users have no visibility into what the system is doing. This defeats the primary purpose of the TUI over the CLI.

Acceptance Criteria

  • A2AClient is injected into MainScreen (or a dedicated event handler)
  • plan.apply_completed event → Flash notification with $success styling
  • plan.error event → Flash notification with $error styling; SideBar marks plan as errored
  • session.message event → Conversation streams ActorResponse content
  • tool.invoked event → Conversation mounts ToolCall widget (pending state)
  • tool.completed event → Conversation updates ToolCall widget (done/fail state)
  • Flash bar supports semantic styling: -success, -error, -warning, -info CSS classes
  • Flash bar auto-dismisses after configurable timeout (default: 3 s)

Subtasks

  • Inject A2AClient into MainScreen (constructor or app-level DI)
  • Implement A2A event subscription setup in MainScreen.on_mount() or dedicated handler
  • Subscribe to plan.apply_completed → call _show_flash() with success message and -success class
  • Subscribe to plan.error → call _show_flash() with error message and -error class; update SideBar
  • Subscribe to session.message → stream ActorResponse content into Conversation widget
  • Subscribe to tool.invoked → mount ToolCall widget in Conversation (pending state)
  • Subscribe to tool.completed → update ToolCall widget in Conversation (done/fail state)
  • Extend Flash bar CSS to support -success, -error, -warning, -info semantic classes
  • Make Flash bar auto-dismiss timeout configurable (default: 3 s)
  • Tests (Behave): Add scenarios for each A2A event → Flash/Conversation widget update
  • Tests (Robot): Add integration test for A2A event subscription lifecycle
  • 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.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly (fix(tui): connect Flash bar and conversation widgets to A2A event subscriptions), 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 (fix/m8-tui-flash-a2a-event-subscription).
  • 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/m8-tui-flash-a2a-event-subscription` - **Commit Message**: `fix(tui): connect Flash bar and conversation widgets to A2A event subscriptions` - **Milestone**: None (Backlog — see note below) - **Parent Epic**: #868 > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.7.0 (M8). It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. ## Background and Context Per **ADR-044** (TUI Architecture and Framework), the TUI subscribes to A2A events for real-time notifications and conversation streaming. The Flash notification bar (height: 1) is specified to auto-dismiss after a configurable timeout and display semantic styling (`$warning` for errors, `$success` for completions). This was inspected in PR #1302 (branch: `feature/m8-tui-mainscreen`) at `src/cleveragents/tui/screens/main_screen.py`. ## Current Behavior In PR #1302 (`feature/m8-tui-mainscreen`): 1. The Flash bar (`_show_flash()` method) exists but is **only** called from: - `action_new_session()` stub - `action_close_session()` stub - `handle_ctrl_c()` double-tap quit warning 2. **No A2A event subscription exists anywhere in the TUI codebase.** 3. `plan.apply_completed`, `plan.error`, `session.message`, `tool.invoked`, `tool.completed` events are never subscribed to. 4. The Flash bar uses a single CSS class (`-visible`) with `$warning` color — no semantic styling for different notification types (success vs error vs info). 5. No `A2AClient` is injected into `MainScreen` or any TUI widget. **Code Location:** - `src/cleveragents/tui/screens/main_screen.py` (branch: `feature/m8-tui-mainscreen`) - `_show_flash()`: exists but not connected to A2A events - No `A2AClient` reference or event subscription - `src/cleveragents/tui/` — no `a2a_client.py`, no `event_handler.py`, no subscription setup ## Expected Behavior Per ADR-044, the TUI subscribes to A2A events for real-time notifications: | Event | TUI Action | |---|---| | `plan.apply_completed` | Flash: show completion notification (`$success` styling) | | `plan.error` | Flash: show error notification (`$error` styling); SideBar: mark plan as errored | | `session.message` | Conversation: stream `ActorResponse` content | | `tool.invoked` | Conversation: mount `ToolCall` widget (pending state) | | `tool.completed` | Conversation: update `ToolCall` widget (done/fail state) | | `plan.phase_changed` | SideBar.PlansPanel: update phase indicator | | `plan.state_changed` | SideBar.PlansPanel: update state badge | The Flash bar should auto-dismiss after a configurable timeout (default: 3 s) and support semantic CSS classes: `-success`, `-error`, `-warning`, `-info`. ## Steps to Reproduce 1. Checkout branch `feature/m8-tui-mainscreen` 2. Inspect `src/cleveragents/tui/screens/main_screen.py` 3. Search for A2A event subscription code — none exists 4. Run a plan that completes or errors 5. **Expected:** Flash notification appears; **Actual:** no notification ## Impact The TUI provides no real-time feedback on plan execution, tool invocations, or actor responses. Users have no visibility into what the system is doing. This defeats the primary purpose of the TUI over the CLI. ## Acceptance Criteria - [ ] `A2AClient` is injected into `MainScreen` (or a dedicated event handler) - [ ] `plan.apply_completed` event → Flash notification with `$success` styling - [ ] `plan.error` event → Flash notification with `$error` styling; SideBar marks plan as errored - [ ] `session.message` event → Conversation streams `ActorResponse` content - [ ] `tool.invoked` event → Conversation mounts `ToolCall` widget (pending state) - [ ] `tool.completed` event → Conversation updates `ToolCall` widget (done/fail state) - [ ] Flash bar supports semantic styling: `-success`, `-error`, `-warning`, `-info` CSS classes - [ ] Flash bar auto-dismisses after configurable timeout (default: 3 s) ## Subtasks - [ ] Inject `A2AClient` into `MainScreen` (constructor or app-level DI) - [ ] Implement A2A event subscription setup in `MainScreen.on_mount()` or dedicated handler - [ ] Subscribe to `plan.apply_completed` → call `_show_flash()` with success message and `-success` class - [ ] Subscribe to `plan.error` → call `_show_flash()` with error message and `-error` class; update SideBar - [ ] Subscribe to `session.message` → stream `ActorResponse` content into Conversation widget - [ ] Subscribe to `tool.invoked` → mount `ToolCall` widget in Conversation (pending state) - [ ] Subscribe to `tool.completed` → update `ToolCall` widget in Conversation (done/fail state) - [ ] Extend Flash bar CSS to support `-success`, `-error`, `-warning`, `-info` semantic classes - [ ] Make Flash bar auto-dismiss timeout configurable (default: 3 s) - [ ] Tests (Behave): Add scenarios for each A2A event → Flash/Conversation widget update - [ ] Tests (Robot): Add integration test for A2A event subscription lifecycle - [ ] 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. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly (`fix(tui): connect Flash bar and conversation widgets to A2A event subscriptions`), 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 (`fix/m8-tui-flash-a2a-event-subscription`). - 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 10:24:17 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Medium — The notification system is an important TUI feature (ADR-044), but not blocking initial TUI development.
  • Milestone: v3.7.0 — TUI implementation work.
  • MoSCoW: Should Have — A2A event-driven notifications are important for real-time TUI feedback. Without this, users miss task status updates.
  • Parent Epic: #868 (TUI Interface, Modals and Persona System)

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: Medium — The notification system is an important TUI feature (ADR-044), but not blocking initial TUI development. - **Milestone**: v3.7.0 — TUI implementation work. - **MoSCoW**: Should Have — A2A event-driven notifications are important for real-time TUI feedback. Without this, users miss task status updates. - **Parent Epic**: #868 (TUI Interface, Modals and Persona System) --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
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#3339
No description provided.