UAT: _cleveragents/context/inspect, simulate, and set A2A handlers are stubs — context management operations always return empty context #2550

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

Metadata

  • Branch: fix/a2a-context-handlers
  • Commit Message: fix(a2a): implement _cleveragents/context/inspect, simulate, set handlers
  • Milestone: v3.6.0
  • Parent Epic: #933

Bug Description

The spec defines four context extension methods. Three of them (inspect, simulate, set) are implemented as stubs that return empty context, and one (show) is also a stub returning an empty context with a TODO comment.

Actual behavior:

# _cleveragents/context/inspect
def _handle_context_stub(self, params: dict[str, Any]) -> dict[str, Any]:
    return {"context": {}, "stub": True}

# _cleveragents/context/show
def _handle_context_get(self, params: dict[str, Any]) -> dict[str, Any]:
    # TODO: Wire to ACMS ContextAssemblyPipeline once available.
    return {
        "context": {},
        "stub": True,
        "message": "ACMS ContextAssemblyPipeline not yet wired",
    }

All four context handlers return {"context": {}, "stub": True} instead of actual context data.

Expected Behavior (from spec)

Per the spec's A2A extension method table:

| Context | _cleveragents/context/show, inspect, simulate, set | ContextService |

  • _cleveragents/context/show: Returns the current assembled context for a plan/session
  • _cleveragents/context/inspect: Returns detailed context inspection data (tier breakdown, token counts, etc.)
  • _cleveragents/context/simulate: Simulates context assembly with given parameters
  • _cleveragents/context/set: Sets context configuration values

The ContextService exists at src/cleveragents/application/services/context_service.py and should be wired into these handlers.

Code Location

  • Stub handlers: src/cleveragents/a2a/facade.py_handle_context_stub() and _handle_context_get() methods
  • Existing service: src/cleveragents/application/services/context_service.py — not wired to facade
  • TODO comment: facade.py line in _handle_context_get(): "TODO: Wire to ACMS ContextAssemblyPipeline once available"

Steps to Reproduce

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

facade = A2aLocalFacade()

# All return stubs
for method in ["_cleveragents/context/show", "_cleveragents/context/inspect",
               "_cleveragents/context/simulate", "_cleveragents/context/set"]:
    response = facade.dispatch(A2aRequest(method=method, params={}))
    assert response.result.get("stub") == True  # All are stubs

Subtasks

  • Wire ContextService into A2aLocalFacade via services dict
  • Implement _handle_context_show() calling ContextService.get_context()
  • Implement _handle_context_inspect() calling ContextService.inspect()
  • Implement _handle_context_simulate() calling ContextService.simulate()
  • Implement _handle_context_set() calling ContextService.set()
  • Remove all "stub": True responses from context handlers
  • Add BDD tests for all four context handlers

Definition of Done

  • All four context handlers return real data from ContextService
  • No "stub": True in context handler responses
  • All handlers have BDD test coverage

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

## Metadata - **Branch**: `fix/a2a-context-handlers` - **Commit Message**: `fix(a2a): implement _cleveragents/context/inspect, simulate, set handlers` - **Milestone**: v3.6.0 - **Parent Epic**: #933 ## Bug Description The spec defines four context extension methods. Three of them (`inspect`, `simulate`, `set`) are implemented as stubs that return empty context, and one (`show`) is also a stub returning an empty context with a TODO comment. **Actual behavior:** ```python # _cleveragents/context/inspect def _handle_context_stub(self, params: dict[str, Any]) -> dict[str, Any]: return {"context": {}, "stub": True} # _cleveragents/context/show def _handle_context_get(self, params: dict[str, Any]) -> dict[str, Any]: # TODO: Wire to ACMS ContextAssemblyPipeline once available. return { "context": {}, "stub": True, "message": "ACMS ContextAssemblyPipeline not yet wired", } ``` All four context handlers return `{"context": {}, "stub": True}` instead of actual context data. ## Expected Behavior (from spec) Per the spec's A2A extension method table: > | **Context** | `_cleveragents/context/show`, `inspect`, `simulate`, `set` | `ContextService` | - `_cleveragents/context/show`: Returns the current assembled context for a plan/session - `_cleveragents/context/inspect`: Returns detailed context inspection data (tier breakdown, token counts, etc.) - `_cleveragents/context/simulate`: Simulates context assembly with given parameters - `_cleveragents/context/set`: Sets context configuration values The `ContextService` exists at `src/cleveragents/application/services/context_service.py` and should be wired into these handlers. ## Code Location - **Stub handlers**: `src/cleveragents/a2a/facade.py` — `_handle_context_stub()` and `_handle_context_get()` methods - **Existing service**: `src/cleveragents/application/services/context_service.py` — not wired to facade - **TODO comment**: `facade.py` line in `_handle_context_get()`: "TODO: Wire to ACMS ContextAssemblyPipeline once available" ## Steps to Reproduce ```python from cleveragents.a2a.facade import A2aLocalFacade from cleveragents.a2a.models import A2aRequest facade = A2aLocalFacade() # All return stubs for method in ["_cleveragents/context/show", "_cleveragents/context/inspect", "_cleveragents/context/simulate", "_cleveragents/context/set"]: response = facade.dispatch(A2aRequest(method=method, params={})) assert response.result.get("stub") == True # All are stubs ``` ## Subtasks - [ ] Wire `ContextService` into `A2aLocalFacade` via `services` dict - [ ] Implement `_handle_context_show()` calling `ContextService.get_context()` - [ ] Implement `_handle_context_inspect()` calling `ContextService.inspect()` - [ ] Implement `_handle_context_simulate()` calling `ContextService.simulate()` - [ ] Implement `_handle_context_set()` calling `ContextService.set()` - [ ] Remove all `"stub": True` responses from context handlers - [ ] Add BDD tests for all four context handlers ## Definition of Done - All four context handlers return real data from `ContextService` - No `"stub": True` in context handler responses - All handlers have BDD test coverage --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • MoSCoW: Should Have — Spec compliance or quality improvement.

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

Issue triaged by project owner: - **State**: Verified - **MoSCoW**: Should Have — Spec compliance or quality improvement. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
freemo added this to the v3.7.0 milestone 2026-04-05 05:07:06 +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#2550
No description provided.