UAT: TUI does not subscribe to A2A events for real-time plan state updates #1387

Open
opened 2026-04-02 17:02:30 +00:00 by freemo · 0 comments
Owner

Bug Report

Feature Area: TuiMaterializer A2A Integration
Severity: High
Found by: UAT tester uat-worker-a2a

What Was Tested

Verified whether the TUI subscribes to A2A events (A2aEventQueue) for real-time updates of agent task states (working, done, error) and plan lifecycle changes.

Expected Behavior (from spec)

Per docs/specification.md line 28847:

"The TUI communicates with the Application layer exclusively through A2A (ADR-026). It subscribes to A2A events for real-time updates..."

Per spec line 23401 (A2A Streaming Events):

Event Type CleverAgents Mapping
TaskStatusUpdateEvent Task state transitions, streaming agent response tokens during plan execution
TaskArtifactUpdateEvent Plan artifacts, tool invocation results, generated outputs

The TUI should subscribe to the A2aEventQueue (via subscribe_local()) and update its widgets when plan state changes occur (e.g., PLAN_PHASE_CHANGED, PLAN_STATE_CHANGED, PLAN_APPLIED, PLAN_ERRORED).

Actual Behavior

No A2A event subscription exists anywhere in the TUI module:

$ grep -rn "subscribe_local\|A2aEventQueue\|EventBusBridge" src/cleveragents/tui/
(no results)

The A2aEventQueue and EventBusBridge classes exist in src/cleveragents/a2a/events.py and work correctly (verified by runtime tests), but the TUI never subscribes to them.

The TUI's on_input_submitted handler in src/cleveragents/tui/app.py (line 152) processes user input through InputModeRouterTuiCommandRouter but never receives or displays real-time A2A event updates.

Code Location

  • src/cleveragents/tui/app.pyon_input_submitted (line 152) and _TextualCleverAgentsTuiApp.__init__ (line 91) — no event subscription
  • src/cleveragents/tui/commands.pyrun_tui() function — does not wire A2aEventQueue to the TUI
  • src/cleveragents/a2a/events.pyA2aEventQueue.subscribe_local() exists but is unused by TUI

Steps to Reproduce

import inspect
import cleveragents.tui.app as app_mod
import cleveragents.tui.commands as cmd_mod

for mod_name, mod in [('app', app_mod), ('commands', cmd_mod)]:
    src = inspect.getsource(mod)
    print(f'{mod_name} - subscribe_local:', 'subscribe_local' in src)  # False
    print(f'{mod_name} - A2aEventQueue:', 'A2aEventQueue' in src)      # False
    print(f'{mod_name} - EventBusBridge:', 'EventBusBridge' in src)    # False

Impact

The TUI cannot display real-time plan execution progress. When a plan transitions through states (queuedprocessingcomplete/errored), the TUI has no mechanism to reflect these changes. Users cannot monitor agent task states in the TUI. The spec's "real-time plan monitoring" capability is entirely absent.

Note: Issue #1315 covers the broader TUI refactoring. This issue specifically tracks the A2A event subscription wiring as a distinct, testable deliverable.

## Bug Report **Feature Area:** TuiMaterializer A2A Integration **Severity:** High **Found by:** UAT tester uat-worker-a2a ### What Was Tested Verified whether the TUI subscribes to A2A events (`A2aEventQueue`) for real-time updates of agent task states (working, done, error) and plan lifecycle changes. ### Expected Behavior (from spec) Per `docs/specification.md` line 28847: > "The TUI communicates with the Application layer exclusively through A2A (ADR-026). It **subscribes to A2A events** for real-time updates..." Per spec line 23401 (A2A Streaming Events): | Event Type | CleverAgents Mapping | |---|---| | `TaskStatusUpdateEvent` | Task state transitions, streaming agent response tokens during plan execution | | `TaskArtifactUpdateEvent` | Plan artifacts, tool invocation results, generated outputs | The TUI should subscribe to the `A2aEventQueue` (via `subscribe_local()`) and update its widgets when plan state changes occur (e.g., `PLAN_PHASE_CHANGED`, `PLAN_STATE_CHANGED`, `PLAN_APPLIED`, `PLAN_ERRORED`). ### Actual Behavior No A2A event subscription exists anywhere in the TUI module: ```bash $ grep -rn "subscribe_local\|A2aEventQueue\|EventBusBridge" src/cleveragents/tui/ (no results) ``` The `A2aEventQueue` and `EventBusBridge` classes exist in `src/cleveragents/a2a/events.py` and work correctly (verified by runtime tests), but the TUI never subscribes to them. The TUI's `on_input_submitted` handler in `src/cleveragents/tui/app.py` (line 152) processes user input through `InputModeRouter` → `TuiCommandRouter` but never receives or displays real-time A2A event updates. ### Code Location - `src/cleveragents/tui/app.py` — `on_input_submitted` (line 152) and `_TextualCleverAgentsTuiApp.__init__` (line 91) — no event subscription - `src/cleveragents/tui/commands.py` — `run_tui()` function — does not wire `A2aEventQueue` to the TUI - `src/cleveragents/a2a/events.py` — `A2aEventQueue.subscribe_local()` exists but is unused by TUI ### Steps to Reproduce ```python import inspect import cleveragents.tui.app as app_mod import cleveragents.tui.commands as cmd_mod for mod_name, mod in [('app', app_mod), ('commands', cmd_mod)]: src = inspect.getsource(mod) print(f'{mod_name} - subscribe_local:', 'subscribe_local' in src) # False print(f'{mod_name} - A2aEventQueue:', 'A2aEventQueue' in src) # False print(f'{mod_name} - EventBusBridge:', 'EventBusBridge' in src) # False ``` ### Impact The TUI cannot display real-time plan execution progress. When a plan transitions through states (`queued` → `processing` → `complete`/`errored`), the TUI has no mechanism to reflect these changes. Users cannot monitor agent task states in the TUI. The spec's "real-time plan monitoring" capability is entirely absent. Note: Issue #1315 covers the broader TUI refactoring. This issue specifically tracks the A2A event subscription wiring as a distinct, testable deliverable.
freemo self-assigned this 2026-04-02 18:45:15 +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.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#1387
No description provided.