fix(agents): add missing astream method to PlanGenerationGraph for spec-alignment #1998

Open
opened 2026-04-03 00:33:05 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/plan-generation-graph-astream
  • Commit Message: fix(agents): add missing astream method to PlanGenerationGraph
  • Milestone: v3.6.0
  • Parent Epic: #397

Background and Context

The PlanGenerationGraph class in src/cleveragents/agents/graphs/plan_generation.py is missing the astream method, which is required by the specification's agent interface contract. The specification mandates that all agents expose four methods: invoke, ainvoke, stream, and astream. Peer agents AutoDebugAgent and ContextAnalysisAgent both implement astream, but PlanGenerationGraph does not.

This is a spec-alignment gap: any caller that relies on the standard agent interface and invokes astream on a PlanGenerationGraph instance will receive an AttributeError at runtime.

Current Behavior

PlanGenerationGraph exposes invoke, ainvoke, and stream methods but has no astream method. Calling astream on an instance raises AttributeError.

Expected Behavior

PlanGenerationGraph exposes all four interface methods: invoke, ainvoke, stream, and astream. The astream method provides an async iterator that streams intermediate and final results of the plan generation workflow, consistent with the pattern used by AutoDebugAgent and ContextAnalysisAgent.

Acceptance Criteria

  • PlanGenerationGraph has an astream method with the correct async iterator signature
  • The astream implementation is consistent with the pattern used by AutoDebugAgent and ContextAnalysisAgent
  • All existing invoke, ainvoke, and stream methods remain unaffected
  • BDD scenarios cover the astream method on PlanGenerationGraph
  • All nox stages pass
  • Coverage >= 97%

Supporting Information

  • File: src/cleveragents/agents/graphs/plan_generation.py
  • Class: PlanGenerationGraph
  • Reference implementations: AutoDebugAgent.astream, ContextAnalysisAgent.astream
  • Category: spec-alignment
  • Severity: Medium — any code path using the standard agent interface will fail at runtime when calling astream

Subtasks

  • Inspect AutoDebugAgent.astream and ContextAnalysisAgent.astream for the reference pattern
  • Implement astream method in PlanGenerationGraph following the same pattern
  • Tests (Behave): Add scenario for PlanGenerationGraph.astream yielding streamed results
  • Tests (Behave): Add scenario verifying PlanGenerationGraph satisfies the full agent interface contract (invoke, ainvoke, stream, astream)
  • Run nox (all default sessions), fix any errors
  • Verify coverage >= 97% via nox -s coverage_report

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly (fix(agents): add missing astream method to PlanGenerationGraph), followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch fix/plan-generation-graph-astream.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass and coverage >= 97%.

Automated by CleverAgents Bot
Supervisor: Bug Hunting | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/plan-generation-graph-astream` - **Commit Message**: `fix(agents): add missing astream method to PlanGenerationGraph` - **Milestone**: v3.6.0 - **Parent Epic**: #397 ## Background and Context The `PlanGenerationGraph` class in `src/cleveragents/agents/graphs/plan_generation.py` is missing the `astream` method, which is required by the specification's agent interface contract. The specification mandates that all agents expose four methods: `invoke`, `ainvoke`, `stream`, and `astream`. Peer agents `AutoDebugAgent` and `ContextAnalysisAgent` both implement `astream`, but `PlanGenerationGraph` does not. This is a spec-alignment gap: any caller that relies on the standard agent interface and invokes `astream` on a `PlanGenerationGraph` instance will receive an `AttributeError` at runtime. ## Current Behavior `PlanGenerationGraph` exposes `invoke`, `ainvoke`, and `stream` methods but has no `astream` method. Calling `astream` on an instance raises `AttributeError`. ## Expected Behavior `PlanGenerationGraph` exposes all four interface methods: `invoke`, `ainvoke`, `stream`, and `astream`. The `astream` method provides an async iterator that streams intermediate and final results of the plan generation workflow, consistent with the pattern used by `AutoDebugAgent` and `ContextAnalysisAgent`. ## Acceptance Criteria - [ ] `PlanGenerationGraph` has an `astream` method with the correct async iterator signature - [ ] The `astream` implementation is consistent with the pattern used by `AutoDebugAgent` and `ContextAnalysisAgent` - [ ] All existing `invoke`, `ainvoke`, and `stream` methods remain unaffected - [ ] BDD scenarios cover the `astream` method on `PlanGenerationGraph` - [ ] All nox stages pass - [ ] Coverage >= 97% ## Supporting Information - **File**: `src/cleveragents/agents/graphs/plan_generation.py` - **Class**: `PlanGenerationGraph` - **Reference implementations**: `AutoDebugAgent.astream`, `ContextAnalysisAgent.astream` - **Category**: spec-alignment - **Severity**: Medium — any code path using the standard agent interface will fail at runtime when calling `astream` ## Subtasks - [ ] Inspect `AutoDebugAgent.astream` and `ContextAnalysisAgent.astream` for the reference pattern - [ ] Implement `astream` method in `PlanGenerationGraph` following the same pattern - [ ] Tests (Behave): Add scenario for `PlanGenerationGraph.astream` yielding streamed results - [ ] Tests (Behave): Add scenario verifying `PlanGenerationGraph` satisfies the full agent interface contract (`invoke`, `ainvoke`, `stream`, `astream`) - [ ] Run `nox` (all default sessions), fix any errors - [ ] Verify coverage >= 97% via `nox -s coverage_report` ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly (`fix(agents): add missing astream method to PlanGenerationGraph`), followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch `fix/plan-generation-graph-astream`. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass and coverage >= 97%. --- **Automated by CleverAgents Bot** Supervisor: Bug Hunting | Agent: ca-new-issue-creator
freemo added this to the v3.6.0 milestone 2026-04-03 00:33:26 +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#1998
No description provided.