TDD: A2aEventQueue not wired in cli_bootstrap.py — event_queue always None in facade #3275

Open
opened 2026-04-05 08:59:33 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: tdd/m6-event-queue-wiring
  • Commit Message: test(a2a): add TDD issue-capture test for missing event_queue wiring in cli_bootstrap
  • Milestone: v3.5.0
  • Parent Epic: #933

Background and Context

Per the Bug Fix Workflow in CONTRIBUTING.md, every Type/Bug issue requires a corresponding Type/Testing TDD issue that proves the bug exists before the fix is implemented. This issue captures the TDD test for the companion bug issue #3278.

The bug: A2aEventQueue is never registered in the A2aLocalFacade services dict by cli_bootstrap.py. The _build_facade() function wires plan_lifecycle_service, session_service, resource_registry_service, and tool_registry — but never sets services["event_queue"]. As a result, A2aLocalFacade._event_queue always returns None, and all event.subscribe calls fall through to the stub path (returning a fake subscription ID with no real queue backing).

Current Behavior

When get_facade() is called from cli_bootstrap and event.subscribe is dispatched:

  1. _handle_event_subscribe calls self._event_queue
  2. _event_queue returns None (key "event_queue" is absent from self._services)
  3. The stub path is taken: a fake subscription_id is returned with no real queue
  4. Published events are never delivered to any subscriber

Expected Behavior

Per docs/specification.md §Event Streaming, the event queue publish/subscribe mechanism must be operational. cli_bootstrap.py must instantiate and register an A2aEventQueue instance so that A2aLocalFacade._event_queue returns a live queue object.

Acceptance Criteria

  • A Behave scenario exists that calls event.subscribe via the facade built by cli_bootstrap._build_facade() and asserts that the returned subscription is backed by a real A2aEventQueue (not the stub path)
  • The scenario is tagged @tdd_issue, @tdd_issue_3278, and @tdd_expected_fail
  • The test fails (assertion fails) when run against the current unfixed code, confirming the bug exists
  • CI passes because @tdd_expected_fail inverts the result

Subtasks

  • Identify or create the appropriate Behave feature file for A2A facade / event queue behavior
  • Write a Gherkin scenario: "Bug #3278 — event_queue is None in facade built by cli_bootstrap"
  • Tag the scenario with @tdd_issue, @tdd_issue_3278, and @tdd_expected_fail
  • Implement step definitions that call _build_facade() and dispatch event.subscribe, asserting the queue is not None and the subscription is real
  • Verify the test fails on unfixed code (assertion fails, CI inverts to pass)
  • Run nox (all default sessions), fix any errors
  • Verify coverage >=97% via nox -s coverage_report

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, 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.
  • The companion bug fix issue #3278 depends on this TDD issue (this issue blocks the bug fix issue).
  • All nox stages pass.
  • Coverage >= 97%.

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

## Metadata - **Branch**: `tdd/m6-event-queue-wiring` - **Commit Message**: `test(a2a): add TDD issue-capture test for missing event_queue wiring in cli_bootstrap` - **Milestone**: v3.5.0 - **Parent Epic**: #933 ## Background and Context Per the Bug Fix Workflow in CONTRIBUTING.md, every `Type/Bug` issue requires a corresponding `Type/Testing` TDD issue that proves the bug exists before the fix is implemented. This issue captures the TDD test for the companion bug issue #3278. The bug: `A2aEventQueue` is never registered in the `A2aLocalFacade` services dict by `cli_bootstrap.py`. The `_build_facade()` function wires `plan_lifecycle_service`, `session_service`, `resource_registry_service`, and `tool_registry` — but never sets `services["event_queue"]`. As a result, `A2aLocalFacade._event_queue` always returns `None`, and all `event.subscribe` calls fall through to the stub path (returning a fake subscription ID with no real queue backing). ## Current Behavior When `get_facade()` is called from `cli_bootstrap` and `event.subscribe` is dispatched: 1. `_handle_event_subscribe` calls `self._event_queue` 2. `_event_queue` returns `None` (key `"event_queue"` is absent from `self._services`) 3. The stub path is taken: a fake `subscription_id` is returned with no real queue 4. Published events are never delivered to any subscriber ## Expected Behavior Per `docs/specification.md` §Event Streaming, the event queue publish/subscribe mechanism must be operational. `cli_bootstrap.py` must instantiate and register an `A2aEventQueue` instance so that `A2aLocalFacade._event_queue` returns a live queue object. ## Acceptance Criteria - [ ] A Behave scenario exists that calls `event.subscribe` via the facade built by `cli_bootstrap._build_facade()` and asserts that the returned subscription is backed by a real `A2aEventQueue` (not the stub path) - [ ] The scenario is tagged `@tdd_issue`, `@tdd_issue_3278`, and `@tdd_expected_fail` - [ ] The test fails (assertion fails) when run against the current unfixed code, confirming the bug exists - [ ] CI passes because `@tdd_expected_fail` inverts the result ## Subtasks - [ ] Identify or create the appropriate Behave feature file for A2A facade / event queue behavior - [ ] Write a Gherkin scenario: "Bug #3278 — event_queue is None in facade built by cli_bootstrap" - [ ] Tag the scenario with `@tdd_issue`, `@tdd_issue_3278`, and `@tdd_expected_fail` - [ ] Implement step definitions that call `_build_facade()` and dispatch `event.subscribe`, asserting the queue is not None and the subscription is real - [ ] Verify the test fails on unfixed code (assertion fails, CI inverts to pass) - [ ] Run `nox` (all default sessions), fix any errors - [ ] Verify coverage >=97% via `nox -s coverage_report` ## 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, 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. - The companion bug fix issue #3278 depends on this TDD issue (this issue blocks the bug fix issue). - All nox stages pass. - Coverage >= 97%. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.5.0 milestone 2026-04-05 09:06:08 +00:00
freemo removed this from the v3.5.0 milestone 2026-04-06 21:05:27 +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.

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