UAT: A2aEventQueue not registered in DI container — event_queue service slot never wired in cli_bootstrap.py #6201

Open
opened 2026-04-09 17:45:18 +00:00 by HAL9000 · 1 comment
Owner

Bug Report

Feature Area: a2a-event-streaming — A2aEventQueue DI container wiring

What Was Tested

Code-level analysis of src/cleveragents/a2a/cli_bootstrap.py and src/cleveragents/application/container.py against the spec at docs/specification.md §A2A Event Queue and the v3.5.0 milestone acceptance criteria ("Event queue publish/subscribe operational").

Expected Behaviour (from spec)

The spec requires A2aEventQueue to be instantiated as a singleton in the DI container and injected into A2aLocalFacade via the event_queue service slot. This enables:

  1. CLI commands to subscribe to plan events via event.subscribe
  2. The EventBusBridge to forward domain events into the queue
  3. The TUI to receive real-time plan progress updates

Actual Behaviour

A2aEventQueue is never instantiated in the DI container or wired into the facade:

  1. src/cleveragents/application/container.py — No a2a_event_queue provider exists. The container wires 30+ services but has zero A2A-specific providers. grep -n "A2aEventQueue\|event_queue\|EventBusBridge" src/cleveragents/application/container.py returns no results.

  2. src/cleveragents/a2a/cli_bootstrap.py_build_facade() wires plan_lifecycle_service, session_service, resource_registry_service, and tool_registry — but never wires event_queue. The services dict passed to A2aLocalFacade has no "event_queue" key.

  3. src/cleveragents/a2a/facade.py_handle_event_subscribe() checks self._event_queue (which reads self._services.get("event_queue")). Since event_queue is never set, this always returns None, causing the handler to return a fake subscription ID with no actual event delivery:

    def _handle_event_subscribe(self, params):
        queue = self._event_queue  # Always None — never wired
        if queue is None:
            return {"subscription_id": str(ULID()), "status": "subscribed"}  # Fake!
    

Code Locations

  • src/cleveragents/a2a/cli_bootstrap.py_build_facade() function, lines ~30-50: event_queue key missing from services dict
  • src/cleveragents/application/container.py — entire file: no a2a_event_queue or event_bus_bridge provider
  • src/cleveragents/a2a/facade.py_handle_event_subscribe(): silently returns fake subscription when queue is None

Steps to Reproduce

from cleveragents.a2a.cli_bootstrap import get_facade
facade = get_facade()
# Check if event_queue is wired:
print(facade._event_queue)  # Always None
# Subscribe — returns fake subscription ID, no events ever delivered:
from cleveragents.a2a.models import A2aRequest
resp = facade.dispatch(A2aRequest(method="event.subscribe", params={}))
print(resp.result)  # {"subscription_id": "...", "status": "subscribed"} — but no events

Impact

  • event.subscribe A2A operation silently returns a fake subscription ID — callers believe they are subscribed but receive no events
  • Plan lifecycle events (PLAN_CREATED, PLAN_PHASE_CHANGED, etc.) are never delivered to any subscriber
  • The v3.5.0 milestone acceptance criterion "Event queue publish/subscribe operational" is not met

Fix Required

  1. Add a2a_event_queue = providers.Singleton(A2aEventQueue) to src/cleveragents/application/container.py
  2. In src/cleveragents/a2a/cli_bootstrap.py _build_facade(), add:
    with contextlib.suppress(Exception):
        services["event_queue"] = container.a2a_event_queue()
    

Metadata

  • Branch: fix/a2a-event-queue-di-wiring
  • Commit Message: fix(a2a): wire A2aEventQueue singleton into DI container and cli_bootstrap facade
  • Milestone: v3.5.0
  • Parent Epic: (to be linked — see dependency note below)

Subtasks

  • Add a2a_event_queue = providers.Singleton(A2aEventQueue) provider to src/cleveragents/application/container.py
  • Wire event_queue service slot in _build_facade() in src/cleveragents/a2a/cli_bootstrap.py
  • Verify A2aLocalFacade._event_queue is no longer None after wiring
  • Write @tdd_issue @tdd_issue_<N> @tdd_expected_fail BDD scenario proving the bug (TDD step)
  • Remove @tdd_expected_fail tag after fix is implemented
  • Confirm event.subscribe delivers real events (not fake subscription IDs)
  • Update documentation if required

Definition of Done

  • A2aEventQueue is registered as a singleton provider in the DI container
  • event_queue service slot is wired in _build_facade() in cli_bootstrap.py
  • A2aLocalFacade._event_queue resolves to a live A2aEventQueue instance (not None)
  • event.subscribe A2A operation delivers real events to subscribers
  • Plan lifecycle events (PLAN_CREATED, PLAN_PHASE_CHANGED, etc.) are forwarded through the queue
  • BDD regression test with @tdd_issue and @tdd_issue_<N> tags exists and passes
  • All nox stages pass
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: new-issue-creator

## Bug Report **Feature Area**: a2a-event-streaming — A2aEventQueue DI container wiring ### What Was Tested Code-level analysis of `src/cleveragents/a2a/cli_bootstrap.py` and `src/cleveragents/application/container.py` against the spec at `docs/specification.md` §A2A Event Queue and the v3.5.0 milestone acceptance criteria ("Event queue publish/subscribe operational"). ### Expected Behaviour (from spec) The spec requires `A2aEventQueue` to be instantiated as a singleton in the DI container and injected into `A2aLocalFacade` via the `event_queue` service slot. This enables: 1. CLI commands to subscribe to plan events via `event.subscribe` 2. The `EventBusBridge` to forward domain events into the queue 3. The TUI to receive real-time plan progress updates ### Actual Behaviour **`A2aEventQueue` is never instantiated in the DI container or wired into the facade:** 1. **`src/cleveragents/application/container.py`** — No `a2a_event_queue` provider exists. The container wires 30+ services but has zero A2A-specific providers. `grep -n "A2aEventQueue\|event_queue\|EventBusBridge" src/cleveragents/application/container.py` returns no results. 2. **`src/cleveragents/a2a/cli_bootstrap.py`** — `_build_facade()` wires `plan_lifecycle_service`, `session_service`, `resource_registry_service`, and `tool_registry` — but **never wires `event_queue`**. The `services` dict passed to `A2aLocalFacade` has no `"event_queue"` key. 3. **`src/cleveragents/a2a/facade.py`** — `_handle_event_subscribe()` checks `self._event_queue` (which reads `self._services.get("event_queue")`). Since `event_queue` is never set, this always returns `None`, causing the handler to return a fake subscription ID with no actual event delivery: ```python def _handle_event_subscribe(self, params): queue = self._event_queue # Always None — never wired if queue is None: return {"subscription_id": str(ULID()), "status": "subscribed"} # Fake! ``` ### Code Locations - `src/cleveragents/a2a/cli_bootstrap.py` — `_build_facade()` function, lines ~30-50: `event_queue` key missing from `services` dict - `src/cleveragents/application/container.py` — entire file: no `a2a_event_queue` or `event_bus_bridge` provider - `src/cleveragents/a2a/facade.py` — `_handle_event_subscribe()`: silently returns fake subscription when queue is None ### Steps to Reproduce ```python from cleveragents.a2a.cli_bootstrap import get_facade facade = get_facade() # Check if event_queue is wired: print(facade._event_queue) # Always None # Subscribe — returns fake subscription ID, no events ever delivered: from cleveragents.a2a.models import A2aRequest resp = facade.dispatch(A2aRequest(method="event.subscribe", params={})) print(resp.result) # {"subscription_id": "...", "status": "subscribed"} — but no events ``` ### Impact - `event.subscribe` A2A operation silently returns a fake subscription ID — callers believe they are subscribed but receive no events - Plan lifecycle events (PLAN_CREATED, PLAN_PHASE_CHANGED, etc.) are never delivered to any subscriber - The v3.5.0 milestone acceptance criterion "Event queue publish/subscribe operational" is not met ### Fix Required 1. Add `a2a_event_queue = providers.Singleton(A2aEventQueue)` to `src/cleveragents/application/container.py` 2. In `src/cleveragents/a2a/cli_bootstrap.py` `_build_facade()`, add: ```python with contextlib.suppress(Exception): services["event_queue"] = container.a2a_event_queue() ``` ## Metadata - **Branch**: `fix/a2a-event-queue-di-wiring` - **Commit Message**: `fix(a2a): wire A2aEventQueue singleton into DI container and cli_bootstrap facade` - **Milestone**: v3.5.0 - **Parent Epic**: _(to be linked — see dependency note below)_ ## Subtasks - [ ] Add `a2a_event_queue = providers.Singleton(A2aEventQueue)` provider to `src/cleveragents/application/container.py` - [ ] Wire `event_queue` service slot in `_build_facade()` in `src/cleveragents/a2a/cli_bootstrap.py` - [ ] Verify `A2aLocalFacade._event_queue` is no longer `None` after wiring - [ ] Write `@tdd_issue @tdd_issue_<N> @tdd_expected_fail` BDD scenario proving the bug (TDD step) - [ ] Remove `@tdd_expected_fail` tag after fix is implemented - [ ] Confirm `event.subscribe` delivers real events (not fake subscription IDs) - [ ] Update documentation if required ## Definition of Done - [ ] `A2aEventQueue` is registered as a singleton provider in the DI container - [ ] `event_queue` service slot is wired in `_build_facade()` in `cli_bootstrap.py` - [ ] `A2aLocalFacade._event_queue` resolves to a live `A2aEventQueue` instance (not `None`) - [ ] `event.subscribe` A2A operation delivers real events to subscribers - [ ] Plan lifecycle events (PLAN_CREATED, PLAN_PHASE_CHANGED, etc.) are forwarded through the queue - [ ] BDD regression test with `@tdd_issue` and `@tdd_issue_<N>` tags exists and passes - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: new-issue-creator
HAL9000 added this to the v3.5.0 milestone 2026-04-09 17:45:44 +00:00
Author
Owner

Verified — Critical: event queue pub/sub is v3.5.0 deliverable #2 and the service slot is never wired in cli_bootstrap.py. MoSCoW: Must Have — v3.5.0 acceptance criterion cannot be met without this fix.


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

✅ **Verified** — Critical: event queue pub/sub is v3.5.0 deliverable #2 and the service slot is never wired in cli_bootstrap.py. **MoSCoW: Must Have** — v3.5.0 acceptance criterion cannot be met without this fix. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
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#6201
No description provided.