UAT: _cleveragents/plan/tree A2A handler always returns empty tree: [] even when PlanLifecycleService is wired — decision tree data never returned #4859

Open
opened 2026-04-08 20:09:57 +00:00 by HAL9000 · 0 comments
Owner

Bug Report

Tested by: UAT tester instance uat-tester-a2a-protocol
Feature area: A2A Protocol — _cleveragents/plan/tree extension method
Severity: Medium — plan decision tree is inaccessible via A2A


What Was Tested

Code-level analysis of src/cleveragents/a2a/facade.py — the _handle_plan_tree handler.

Expected Behavior (from spec)

_cleveragents/plan/tree should return the full decision tree for a plan, including all decision nodes with their IDs, types, questions, chosen alternatives, and child relationships.

Actual Behavior

The _handle_plan_tree handler (lines ~360–370 of facade.py) fetches the plan but always returns an empty tree: []:

def _handle_plan_tree(self, params: dict[str, Any]) -> dict[str, Any]:
    plan_id = params.get("plan_id", "")
    svc = self._plan_lifecycle_service
    if svc is None or not plan_id:
        return {"plan_id": plan_id, "tree": [], "stub": True}
    plan = svc.get_plan(plan_id)
    return {
        "plan_id": plan_id,
        "decision_root_id": plan.decision_root_id if plan else None,
        "tree": [],  # ← ALWAYS EMPTY — never populated with actual decision nodes
    }

The handler correctly fetches the plan and extracts decision_root_id, but then returns "tree": [] unconditionally. The actual decision tree nodes are never fetched or serialized.

Code Location

  • src/cleveragents/a2a/facade.py_handle_plan_tree method

Steps to Reproduce

from cleveragents.a2a.facade import A2aLocalFacade
from cleveragents.a2a.models import A2aRequest

# With a real plan_lifecycle_service wired:
facade = A2aLocalFacade(services={"plan_lifecycle_service": real_svc})
resp = facade.dispatch(A2aRequest(method="_cleveragents/plan/tree",
                                   params={"plan_id": "01HXTEST"}))
print(resp.result["tree"])  # Always [] even if plan has decisions

Expected Fix

The handler should call svc.get_decisions(plan_id) (or equivalent) to retrieve all decision nodes and serialize them into the tree list. The response should include each decision's id, type, question, chosen, confidence, sequence_number, and children.


Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## Bug Report **Tested by:** UAT tester instance `uat-tester-a2a-protocol` **Feature area:** A2A Protocol — `_cleveragents/plan/tree` extension method **Severity:** Medium — plan decision tree is inaccessible via A2A --- ### What Was Tested Code-level analysis of `src/cleveragents/a2a/facade.py` — the `_handle_plan_tree` handler. ### Expected Behavior (from spec) `_cleveragents/plan/tree` should return the full decision tree for a plan, including all decision nodes with their IDs, types, questions, chosen alternatives, and child relationships. ### Actual Behavior The `_handle_plan_tree` handler (lines ~360–370 of `facade.py`) fetches the plan but always returns an empty `tree: []`: ```python def _handle_plan_tree(self, params: dict[str, Any]) -> dict[str, Any]: plan_id = params.get("plan_id", "") svc = self._plan_lifecycle_service if svc is None or not plan_id: return {"plan_id": plan_id, "tree": [], "stub": True} plan = svc.get_plan(plan_id) return { "plan_id": plan_id, "decision_root_id": plan.decision_root_id if plan else None, "tree": [], # ← ALWAYS EMPTY — never populated with actual decision nodes } ``` The handler correctly fetches the plan and extracts `decision_root_id`, but then returns `"tree": []` unconditionally. The actual decision tree nodes are never fetched or serialized. ### Code Location - `src/cleveragents/a2a/facade.py` — `_handle_plan_tree` method ### Steps to Reproduce ```python from cleveragents.a2a.facade import A2aLocalFacade from cleveragents.a2a.models import A2aRequest # With a real plan_lifecycle_service wired: facade = A2aLocalFacade(services={"plan_lifecycle_service": real_svc}) resp = facade.dispatch(A2aRequest(method="_cleveragents/plan/tree", params={"plan_id": "01HXTEST"})) print(resp.result["tree"]) # Always [] even if plan has decisions ``` ### Expected Fix The handler should call `svc.get_decisions(plan_id)` (or equivalent) to retrieve all decision nodes and serialize them into the `tree` list. The response should include each decision's `id`, `type`, `question`, `chosen`, `confidence`, `sequence_number`, and `children`. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.5.0 milestone 2026-04-08 20:16:23 +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#4859
No description provided.