UAT: _cleveragents/plan/rollback A2A handler ignores checkpoint_id parameter — rollback target is never passed to service #2387

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

Metadata

  • Branch: fix/a2a-plan-rollback-checkpoint-id
  • Commit Message: fix(a2a): pass checkpoint_id to service in _handle_plan_rollback and validate required param
  • Milestone: v3.4.0
  • Parent Epic: #933

Bug Report

Feature Area: API Endpoints / A2A Protocol — Plan Lifecycle

What was tested

The _cleveragents/plan/rollback A2A extension method handler in A2aLocalFacade (src/cleveragents/a2a/facade.py).

Expected behavior (from spec)

Per docs/specification.md CLI command reference:

agents plan rollback [--yes|-y] <PLAN_ID> <CHECKPOINT_ID>

CHECKPOINT_ID is a required positional argument — the user must specify which checkpoint to roll back to. The _cleveragents/plan/rollback A2A method must accept and use a checkpoint_id parameter to identify the rollback target.

Actual behavior (from code analysis)

The _handle_plan_rollback handler in src/cleveragents/a2a/facade.py (lines 546-548) is a stub that completely ignores the checkpoint_id parameter:

def _handle_plan_rollback(self, params: dict[str, Any]) -> dict[str, Any]:
    plan_id = params.get("plan_id", "")
    return {"plan_id": plan_id, "status": "rolled_back", "stub": True}

The handler:

  1. Does not extract checkpoint_id from params
  2. Does not call any service method
  3. Always returns a stub response regardless of whether a service is wired
  4. Does not validate that checkpoint_id is provided (it's required per spec)

This means agents plan rollback <PLAN_ID> <CHECKPOINT_ID> cannot actually roll back to a specific checkpoint via the A2A facade.

Steps to reproduce

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

facade = A2aLocalFacade(services={"plan_lifecycle_service": mock_service})
response = facade.dispatch(A2aRequest(
    method="_cleveragents/plan/rollback",
    params={"plan_id": "01HXRCF1...", "checkpoint_id": "CHKPT-001"}
))
# Returns {"plan_id": "...", "status": "rolled_back", "stub": True}
# No actual rollback occurs; checkpoint_id is silently ignored

Code location

  • src/cleveragents/a2a/facade.py_handle_plan_rollback() method (lines 546-548)

Severity

High — The rollback feature is non-functional via the A2A facade. The checkpoint_id required parameter is silently ignored, making it impossible to roll back to a specific checkpoint through the standard A2A interface.

Subtasks

  • Extract checkpoint_id from params in _handle_plan_rollback and raise ValueError if it is absent or empty
  • Wire _handle_plan_rollback to the injected plan_lifecycle_service, calling the appropriate rollback method with both plan_id and checkpoint_id
  • Remove the "stub": True sentinel from the return value and return the real service response
  • Add full static type annotations to _handle_plan_rollback (parameter and return types)
  • Write BDD scenarios in features/ covering: missing checkpoint_id raises error, empty checkpoint_id raises error, valid call delegates to service with correct arguments
  • Ensure nox -e typecheck passes with no suppressions
  • Ensure nox -e coverage_report reports ≥ 97% coverage

Definition of Done

  • _handle_plan_rollback extracts and validates checkpoint_id as a required parameter, raising an appropriate error when absent
  • _handle_plan_rollback delegates to the injected plan_lifecycle_service with both plan_id and checkpoint_id
  • No "stub": True sentinel remains in the production response path
  • BDD scenarios cover the missing-param, empty-param, and happy-path cases
  • All nox stages pass
  • Coverage >= 97%

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

## Metadata - **Branch**: `fix/a2a-plan-rollback-checkpoint-id` - **Commit Message**: `fix(a2a): pass checkpoint_id to service in _handle_plan_rollback and validate required param` - **Milestone**: v3.4.0 - **Parent Epic**: #933 ## Bug Report **Feature Area**: API Endpoints / A2A Protocol — Plan Lifecycle ### What was tested The `_cleveragents/plan/rollback` A2A extension method handler in `A2aLocalFacade` (`src/cleveragents/a2a/facade.py`). ### Expected behavior (from spec) Per `docs/specification.md` CLI command reference: ``` agents plan rollback [--yes|-y] <PLAN_ID> <CHECKPOINT_ID> ``` `CHECKPOINT_ID` is a **required positional argument** — the user must specify which checkpoint to roll back to. The `_cleveragents/plan/rollback` A2A method must accept and use a `checkpoint_id` parameter to identify the rollback target. ### Actual behavior (from code analysis) The `_handle_plan_rollback` handler in `src/cleveragents/a2a/facade.py` (lines 546-548) is a stub that **completely ignores the `checkpoint_id` parameter**: ```python def _handle_plan_rollback(self, params: dict[str, Any]) -> dict[str, Any]: plan_id = params.get("plan_id", "") return {"plan_id": plan_id, "status": "rolled_back", "stub": True} ``` The handler: 1. Does not extract `checkpoint_id` from params 2. Does not call any service method 3. Always returns a stub response regardless of whether a service is wired 4. Does not validate that `checkpoint_id` is provided (it's required per spec) This means `agents plan rollback <PLAN_ID> <CHECKPOINT_ID>` cannot actually roll back to a specific checkpoint via the A2A facade. ### Steps to reproduce ```python from cleveragents.a2a.facade import A2aLocalFacade from cleveragents.a2a.models import A2aRequest facade = A2aLocalFacade(services={"plan_lifecycle_service": mock_service}) response = facade.dispatch(A2aRequest( method="_cleveragents/plan/rollback", params={"plan_id": "01HXRCF1...", "checkpoint_id": "CHKPT-001"} )) # Returns {"plan_id": "...", "status": "rolled_back", "stub": True} # No actual rollback occurs; checkpoint_id is silently ignored ``` ### Code location - `src/cleveragents/a2a/facade.py` — `_handle_plan_rollback()` method (lines 546-548) ### Severity **High** — The rollback feature is non-functional via the A2A facade. The `checkpoint_id` required parameter is silently ignored, making it impossible to roll back to a specific checkpoint through the standard A2A interface. ## Subtasks - [ ] Extract `checkpoint_id` from `params` in `_handle_plan_rollback` and raise `ValueError` if it is absent or empty - [ ] Wire `_handle_plan_rollback` to the injected `plan_lifecycle_service`, calling the appropriate rollback method with both `plan_id` and `checkpoint_id` - [ ] Remove the `"stub": True` sentinel from the return value and return the real service response - [ ] Add full static type annotations to `_handle_plan_rollback` (parameter and return types) - [ ] Write BDD scenarios in `features/` covering: missing `checkpoint_id` raises error, empty `checkpoint_id` raises error, valid call delegates to service with correct arguments - [ ] Ensure `nox -e typecheck` passes with no suppressions - [ ] Ensure `nox -e coverage_report` reports ≥ 97% coverage ## Definition of Done - [ ] `_handle_plan_rollback` extracts and validates `checkpoint_id` as a required parameter, raising an appropriate error when absent - [ ] `_handle_plan_rollback` delegates to the injected `plan_lifecycle_service` with both `plan_id` and `checkpoint_id` - [ ] No `"stub": True` sentinel remains in the production response path - [ ] BDD scenarios cover the missing-param, empty-param, and happy-path cases - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.4.0 milestone 2026-04-03 17:28:10 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: High (correct — plan rollback is a core plan lifecycle feature)
  • Milestone: v3.4.0 (correct)
  • MoSCoW: Should Have — Plan rollback is a spec-required feature. The handler being a stub that ignores the checkpoint_id means the feature is non-functional via A2A. This should be fixed for v3.4.0 acceptance.
  • Parent Epic: #933

Well-documented stub bug with clear fix path.


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

Issue triaged by project owner: - **State**: Verified ✅ - **Priority**: High (correct — plan rollback is a core plan lifecycle feature) - **Milestone**: v3.4.0 (correct) - **MoSCoW**: Should Have — Plan rollback is a spec-required feature. The handler being a stub that ignores the checkpoint_id means the feature is non-functional via A2A. This should be fixed for v3.4.0 acceptance. - **Parent Epic**: #933 Well-documented stub bug with clear fix path. --- **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.

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