Bug: _cleveragents/plan/list A2A handler ignores all filter parameters — namespace, phase, and project_name never passed to list_plans() #2554

Open
opened 2026-04-03 18:53:17 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: bugfix/m9-a2a-plan-list-filter-params
  • Commit Message: fix(a2a): pass filter params from plan/list handler to list_plans()
  • Milestone: v3.8.0
  • Parent Epic: #399

Background and Context

The _handle_plan_list method in src/cleveragents/a2a/facade.py (lines 567–577) always calls svc.list_plans() with no arguments, silently discarding any filter parameters passed in the A2A request. The PlanLifecycleService.list_plans() method supports namespace, phase, and project_name filtering, but the A2A handler never forwards these from the incoming params dict.

Per spec §43273, the _cleveragents/plan/list A2A extension method must map to PlanService.list() and support the same filtering capabilities as the CLI agents plan list command (which supports --phase, --state, --project, and --action filters).

Current Behavior

The handler always returns all plans regardless of what filter parameters are passed in the A2A request:

def _handle_plan_list(self, params: dict[str, Any]) -> dict[str, Any]:
    svc = self._plan_lifecycle_service
    if svc is None:
        return {"plans": [], "stub": True}
    plans = svc.list_plans()  # BUG: namespace/phase/project_name from `params` are ignored
    return {
        "plans": [
            {"plan_id": p.identity.plan_id, "phase": p.phase.value} for p in plans
        ],
        "total": len(plans),
    }

Additionally, the response shape is incomplete — it only returns plan_id and phase, omitting fields required by the spec (state, action_name, namespaced_name).

Expected Behavior

Per spec §43273, the _cleveragents/plan/list A2A extension method should:

  1. Extract namespace, phase, and project_name from the incoming params dict and forward them to svc.list_plans(namespace=..., phase=..., project_name=...).
  2. Return a response that includes at minimum: plan_id, phase, state, action_name, and namespaced_name for each plan — matching the spec's expected output and the CLI agents plan list output.

Acceptance Criteria

  • Passing namespace in A2A request params filters plans to that namespace only.
  • Passing phase in A2A request params filters plans to that phase only.
  • Passing project_name in A2A request params filters plans to that project only.
  • Omitting filter params returns all plans (existing behaviour preserved).
  • Response includes plan_id, phase, state, action_name, and namespaced_name for each plan.
  • All nox stages pass with coverage ≥ 97%.

Supporting Information

  • Code location: src/cleveragents/a2a/facade.py, method _handle_plan_list (lines 567–577)
  • Spec reference: §43273 — _cleveragents/plan/list A2A extension method
  • Related CLI command: agents plan list (supports --phase, --state, --project, --action filters)
  • Parent Epic: #399 (Epic: Post-MVP Server & Clients)

Subtasks

  • Extract namespace, phase, and project_name from params in _handle_plan_list
  • Pass extracted filter values to svc.list_plans(namespace=..., phase=..., project_name=...)
  • Expand response payload to include state, action_name, and namespaced_name fields per spec §43273
  • Tests (Behave): Add scenario — _cleveragents/plan/list with namespace filter returns only matching plans
  • Tests (Behave): Add scenario — _cleveragents/plan/list with phase filter returns only matching plans
  • Tests (Behave): Add scenario — _cleveragents/plan/list with project_name filter returns only matching plans
  • Tests (Behave): Add scenario — _cleveragents/plan/list with no filters returns all plans
  • Tests (Behave): Add scenario — response shape includes all required fields (plan_id, phase, state, action_name, namespaced_name)
  • Tests (Robot): Add integration test verifying end-to-end filter behaviour via A2A facade
  • 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(a2a): pass filter params from plan/list handler to list_plans()), 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 (bugfix/m9-a2a-plan-list-filter-params).
  • 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-new-issue-creator

## Metadata - **Branch**: `bugfix/m9-a2a-plan-list-filter-params` - **Commit Message**: `fix(a2a): pass filter params from plan/list handler to list_plans()` - **Milestone**: v3.8.0 - **Parent Epic**: #399 ## Background and Context The `_handle_plan_list` method in `src/cleveragents/a2a/facade.py` (lines 567–577) always calls `svc.list_plans()` with no arguments, silently discarding any filter parameters passed in the A2A request. The `PlanLifecycleService.list_plans()` method supports `namespace`, `phase`, and `project_name` filtering, but the A2A handler never forwards these from the incoming `params` dict. Per spec §43273, the `_cleveragents/plan/list` A2A extension method must map to `PlanService.list()` and support the same filtering capabilities as the CLI `agents plan list` command (which supports `--phase`, `--state`, `--project`, and `--action` filters). ## Current Behavior The handler always returns all plans regardless of what filter parameters are passed in the A2A request: ```python def _handle_plan_list(self, params: dict[str, Any]) -> dict[str, Any]: svc = self._plan_lifecycle_service if svc is None: return {"plans": [], "stub": True} plans = svc.list_plans() # BUG: namespace/phase/project_name from `params` are ignored return { "plans": [ {"plan_id": p.identity.plan_id, "phase": p.phase.value} for p in plans ], "total": len(plans), } ``` Additionally, the response shape is incomplete — it only returns `plan_id` and `phase`, omitting fields required by the spec (`state`, `action_name`, `namespaced_name`). ## Expected Behavior Per spec §43273, the `_cleveragents/plan/list` A2A extension method should: 1. Extract `namespace`, `phase`, and `project_name` from the incoming `params` dict and forward them to `svc.list_plans(namespace=..., phase=..., project_name=...)`. 2. Return a response that includes at minimum: `plan_id`, `phase`, `state`, `action_name`, and `namespaced_name` for each plan — matching the spec's expected output and the CLI `agents plan list` output. ## Acceptance Criteria - [ ] Passing `namespace` in A2A request params filters plans to that namespace only. - [ ] Passing `phase` in A2A request params filters plans to that phase only. - [ ] Passing `project_name` in A2A request params filters plans to that project only. - [ ] Omitting filter params returns all plans (existing behaviour preserved). - [ ] Response includes `plan_id`, `phase`, `state`, `action_name`, and `namespaced_name` for each plan. - [ ] All nox stages pass with coverage ≥ 97%. ## Supporting Information - **Code location**: `src/cleveragents/a2a/facade.py`, method `_handle_plan_list` (lines 567–577) - **Spec reference**: §43273 — `_cleveragents/plan/list` A2A extension method - **Related CLI command**: `agents plan list` (supports `--phase`, `--state`, `--project`, `--action` filters) - **Parent Epic**: #399 (Epic: Post-MVP Server & Clients) ## Subtasks - [ ] Extract `namespace`, `phase`, and `project_name` from `params` in `_handle_plan_list` - [ ] Pass extracted filter values to `svc.list_plans(namespace=..., phase=..., project_name=...)` - [ ] Expand response payload to include `state`, `action_name`, and `namespaced_name` fields per spec §43273 - [ ] Tests (Behave): Add scenario — `_cleveragents/plan/list` with `namespace` filter returns only matching plans - [ ] Tests (Behave): Add scenario — `_cleveragents/plan/list` with `phase` filter returns only matching plans - [ ] Tests (Behave): Add scenario — `_cleveragents/plan/list` with `project_name` filter returns only matching plans - [ ] Tests (Behave): Add scenario — `_cleveragents/plan/list` with no filters returns all plans - [ ] Tests (Behave): Add scenario — response shape includes all required fields (`plan_id`, `phase`, `state`, `action_name`, `namespaced_name`) - [ ] Tests (Robot): Add integration test verifying end-to-end filter behaviour via A2A facade - [ ] 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(a2a): pass filter params from plan/list handler to list_plans()`), 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 (`bugfix/m9-a2a-plan-list-filter-params`). - 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-new-issue-creator
freemo added this to the v3.8.0 milestone 2026-04-03 18:53:27 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • MoSCoW: Should Have

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

Issue triaged by project owner: - **State**: Verified - **MoSCoW**: Should Have --- **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
#399 Epic: Post-MVP Server & Clients
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#2554
No description provided.