_cleveragents/plan/diff always returns an empty changes list #6275

Open
opened 2026-04-09 19:45:55 +00:00 by HAL9000 · 0 comments
Owner

Summary

_cleveragents/plan/diff always returns an empty changes list, even when the plan lifecycle service is wired and the plan has a ChangeSet. The handler at src/cleveragents/a2a/facade.py lines 417-429 calls plan_lifecycle_service.get_plan(plan_id) but then throws the result away and responds with {"changes": []}. No diff data is ever surfaced to the A2A client.

Steps to Reproduce

  1. Register a plan lifecycle service with the facade (e.g. a stub whose get_plan() returns a plan with a populated ChangeSet/Change list).
  2. Dispatch _cleveragents/plan/diff or legacy plan.diff via A2aLocalFacade.dispatch().
  3. Inspect the result payload: the changes array is always empty regardless of the plan contents.

Expected Result

Per docs/specification.md (§agents plan diff and §A2A extension methods), _cleveragents/plan/diff should expose the same change information that backs the CLI diff command—at minimum the ChangeSet entries or rendered diff summary. This allows remote clients to review pending changes and drive approval workflows.

Actual Result

The response is always:

{"plan_id": "...", "changes": [], "phase": "..."}

Even with a fully populated plan, the array is empty because the handler never queries a diff service.

Impact

Remote tools integrating over A2A cannot retrieve plan diffs, so they cannot implement change review, auditing, or automation that depends on the ChangeSet contents. The CLI’s diff command calls PlanApplyService.diff() directly, but the A2A facade—which is the contract for remote/GUI clients—returns a stub. This violates the spec’s promise that the _cleveragents/plan/* extension methods mirror the CLI functionality.

Code References

  • src/cleveragents/a2a/facade.py lines 417-429: _handle_plan_diff() hardcodes "changes": [].
  • src/cleveragents/application/services/plan_apply_service.py lines 286-355: PlanApplyService.diff() already renders diff data but is never invoked by the facade.

Suggested Fix

Have _handle_plan_diff() delegate to a real diff provider (likely PlanApplyService.diff() or a new service method that returns structured ChangeSet data) instead of returning a stub. Consider injecting the apply service (similar to plan_lifecycle_service) so the facade can stream actual diff content.

## Summary `_cleveragents/plan/diff` always returns an empty `changes` list, even when the plan lifecycle service is wired and the plan has a ChangeSet. The handler at `src/cleveragents/a2a/facade.py` lines 417-429 calls `plan_lifecycle_service.get_plan(plan_id)` but then throws the result away and responds with `{"changes": []}`. No diff data is ever surfaced to the A2A client. ## Steps to Reproduce 1. Register a plan lifecycle service with the facade (e.g. a stub whose `get_plan()` returns a plan with a populated ChangeSet/Change list). 2. Dispatch `_cleveragents/plan/diff` or legacy `plan.diff` via `A2aLocalFacade.dispatch()`. 3. Inspect the `result` payload: the `changes` array is always empty regardless of the plan contents. ## Expected Result Per docs/specification.md (§agents plan diff and §A2A extension methods), `_cleveragents/plan/diff` should expose the same change information that backs the CLI diff command—at minimum the ChangeSet entries or rendered diff summary. This allows remote clients to review pending changes and drive approval workflows. ## Actual Result The response is always: ```json {"plan_id": "...", "changes": [], "phase": "..."} ``` Even with a fully populated plan, the array is empty because the handler never queries a diff service. ## Impact Remote tools integrating over A2A cannot retrieve plan diffs, so they cannot implement change review, auditing, or automation that depends on the ChangeSet contents. The CLI’s diff command calls `PlanApplyService.diff()` directly, but the A2A facade—which is the contract for remote/GUI clients—returns a stub. This violates the spec’s promise that the `_cleveragents/plan/*` extension methods mirror the CLI functionality. ## Code References - `src/cleveragents/a2a/facade.py` lines 417-429: `_handle_plan_diff()` hardcodes `"changes": []`. - `src/cleveragents/application/services/plan_apply_service.py` lines 286-355: `PlanApplyService.diff()` already renders diff data but is never invoked by the facade. ## Suggested Fix Have `_handle_plan_diff()` delegate to a real diff provider (likely `PlanApplyService.diff()` or a new service method that returns structured ChangeSet data) instead of returning a stub. Consider injecting the apply service (similar to `plan_lifecycle_service`) so the facade can stream actual diff content.
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#6275
No description provided.