UAT: A2A facade _cleveragents/plan/tree always returns empty tree — decision tree not fetched from plan even when decision_root_id is set #3122

Open
opened 2026-04-05 06:34:29 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/a2a-plan-tree-decision-fetch
  • Commit Message: fix(a2a): fetch and return decision tree nodes in plan/tree handler
  • Milestone: v3.5.0
  • Parent Epic: #397

Bug Report

Feature Area: A2A Facade — Plan Lifecycle Operations (M6: Autonomy Hardening)

What was tested

The A2A local facade handler for _cleveragents/plan/tree operation.

Expected behavior (from spec)

Per docs/specification.md §Plan Lifecycle, the _cleveragents/plan/tree operation should return the full decision tree for a plan, including all decision nodes, their types, and relationships. This is essential for hierarchical plan decomposition visibility.

Actual behavior (from code analysis)

In src/cleveragents/a2a/facade.py, _handle_plan_tree always returns an empty tree:

# Lines 506-516
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 — decision tree never fetched
    }

Even when the service is available and the plan has a decision_root_id, the tree field is always an empty list []. The handler fetches the plan to get decision_root_id but then never uses it to fetch the actual decision tree nodes.

The PlanExecutor stores decision tree data (lines 530, 542, 553, 594, 597 of plan_executor.py), and DecisionService has methods to retrieve decisions, but _handle_plan_tree never queries them.

Code location

  • src/cleveragents/a2a/facade.py, lines 506-516 (_handle_plan_tree)
  • src/cleveragents/application/services/plan_executor.py, lines 530, 542, 553 (decision_root_id usage)
  • src/cleveragents/application/services/decision_service.py (decision retrieval)

Steps to reproduce

  1. Create and execute a plan so it has a decision_root_id
  2. Dispatch _cleveragents/plan/tree with the plan's ID via the A2A facade
  3. Observe that tree is always [] even though the plan has decisions

Impact

  • Hierarchical plan decomposition (4+ levels) visibility is completely broken via the A2A protocol
  • Any A2A client or CLI command using agents plan tree receives no decision tree data
  • This is a core M6 Autonomy Hardening deliverable — plan tree visibility is required for monitoring hierarchical decomposition

Subtasks

  • Wire _handle_plan_tree to fetch decision nodes from DecisionService using decision_root_id
  • Return a structured tree with decision nodes, types, and parent/child relationships
  • Add BDD tests for _handle_plan_tree with a plan that has decisions
  • Verify the tree structure matches the spec's expected format

Definition of Done

  • _handle_plan_tree returns actual decision tree nodes when the plan has a decision_root_id
  • The tree field contains a list of decision node dicts (not always empty)
  • BDD tests cover plans with and without decision trees
  • All nox stages pass
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-issue-state-updater

## Metadata - **Branch**: `fix/a2a-plan-tree-decision-fetch` - **Commit Message**: `fix(a2a): fetch and return decision tree nodes in plan/tree handler` - **Milestone**: v3.5.0 - **Parent Epic**: #397 ## Bug Report **Feature Area**: A2A Facade — Plan Lifecycle Operations (M6: Autonomy Hardening) ### What was tested The A2A local facade handler for `_cleveragents/plan/tree` operation. ### Expected behavior (from spec) Per `docs/specification.md` §Plan Lifecycle, the `_cleveragents/plan/tree` operation should return the full decision tree for a plan, including all decision nodes, their types, and relationships. This is essential for hierarchical plan decomposition visibility. ### Actual behavior (from code analysis) In `src/cleveragents/a2a/facade.py`, `_handle_plan_tree` always returns an empty tree: ```python # Lines 506-516 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 — decision tree never fetched } ``` Even when the service is available and the plan has a `decision_root_id`, the `tree` field is always an empty list `[]`. The handler fetches the plan to get `decision_root_id` but then never uses it to fetch the actual decision tree nodes. The `PlanExecutor` stores decision tree data (lines 530, 542, 553, 594, 597 of `plan_executor.py`), and `DecisionService` has methods to retrieve decisions, but `_handle_plan_tree` never queries them. ### Code location - `src/cleveragents/a2a/facade.py`, lines 506-516 (`_handle_plan_tree`) - `src/cleveragents/application/services/plan_executor.py`, lines 530, 542, 553 (decision_root_id usage) - `src/cleveragents/application/services/decision_service.py` (decision retrieval) ### Steps to reproduce 1. Create and execute a plan so it has a `decision_root_id` 2. Dispatch `_cleveragents/plan/tree` with the plan's ID via the A2A facade 3. Observe that `tree` is always `[]` even though the plan has decisions ### Impact - Hierarchical plan decomposition (4+ levels) visibility is completely broken via the A2A protocol - Any A2A client or CLI command using `agents plan tree` receives no decision tree data - This is a core M6 Autonomy Hardening deliverable — plan tree visibility is required for monitoring hierarchical decomposition ## Subtasks - [ ] Wire `_handle_plan_tree` to fetch decision nodes from `DecisionService` using `decision_root_id` - [ ] Return a structured tree with decision nodes, types, and parent/child relationships - [ ] Add BDD tests for `_handle_plan_tree` with a plan that has decisions - [ ] Verify the tree structure matches the spec's expected format ## Definition of Done - [ ] `_handle_plan_tree` returns actual decision tree nodes when the plan has a `decision_root_id` - [ ] The `tree` field contains a list of decision node dicts (not always empty) - [ ] BDD tests cover plans with and without decision trees - All nox stages pass - Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-issue-state-updater
freemo added this to the v3.5.0 milestone 2026-04-05 06:34:47 +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.

Blocks
#397 Epic: Server & Autonomy Infrastructure
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3122
No description provided.