Tests (Behave): Add missing Behave feature file for the agents module #2783

Open
opened 2026-04-04 19:27:25 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: test/agents-behave-feature
  • Commit Message: test(agents): add Behave feature file covering agents module behaviour
  • Milestone: v3.7.0
  • Parent Epic: #933

Background and Context

The src/cleveragents/agents/ module contains the following sub-modules and public classes (confirmed via source inspection):

  • base — Abstract Agent base class and AgentWithMemory mixin (observable message processing, capability introspection, lifecycle management)
  • graphs/auto_debugAutoDebugAgent / AutoDebugState (LangGraph-based error analysis → fix generation → fix validation workflow)
  • graphs/context_analysisContextAnalysisAgent / ContextAnalysisState (file loading → dependency analysis → chunking → relevance scoring → summarisation)
  • graphs/plan_generationPlanGenerationGraph / PlanGenerationState (prompt → context load → requirements analysis → plan generation → validation workflow)

Per the project specification (ADR-011, §Architecture), all LangGraph-based agent workflows are the core execution engine of the CleverAgents platform. Every public behaviour of the agents module must be covered by Behave acceptance tests so that regressions in the agent execution pipeline are caught before they reach production.

A scan of /features/ confirms that no .feature file currently targets the core agents moduleagent_skills_loader.feature covers only the skills loader sub-system, leaving the base agent abstractions and all three LangGraph graph agents entirely untested at the BDD acceptance level.

Expected Behaviour

A features/agents.feature file (and any necessary step definitions in features/steps/) should exist that exercises the public API of each agents sub-module, including:

  • Agent base class instantiation, configuration, and capability introspection
  • Agent.process_message_sync — synchronous message processing pipeline
  • Agent.send_message / subscribe_to_output / create_observable — reactive observable interface
  • Agent.get_metadata — metadata retrieval
  • Agent.dispose — lifecycle teardown
  • AgentWithMemory — memory-augmented agent construction
  • AutoDebugAgent.invoke — synchronous error analysis and fix generation (happy path and retry scenarios)
  • AutoDebugAgent.stream — streaming execution of the debug workflow
  • ContextAnalysisAgent.invoke — synchronous context analysis (happy path and empty-file edge cases)
  • ContextAnalysisAgent.stream — streaming context analysis
  • PlanGenerationGraph.invoke — synchronous plan generation (happy path and validation-retry scenarios)
  • PlanGenerationGraph.stream — streaming plan generation
  • Lazy-load __getattr__ on the agents package — correct resolution of all exported names

All LLM interactions must be mocked using FakeListLLM (or equivalent) placed in features/mocks/ per the project mocking policy.

Subtasks

  • Audit each agents sub-module (base, graphs/auto_debug, graphs/context_analysis, graphs/plan_generation) and list all public behaviours to be covered
  • Write features/agents.feature with Gherkin scenarios for each identified behaviour
  • Add mock LLM fixtures (e.g. FakeListLLM wrappers) to features/mocks/ as required
  • Implement any missing step definitions in features/steps/
  • Run nox -s behave locally and confirm all new scenarios pass
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions) and fix any errors

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 (test(agents): add Behave feature file covering agents module behaviour), followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly (test/agents-behave-feature).
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass.
  • Coverage >= 97%.

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

## Metadata - **Branch**: `test/agents-behave-feature` - **Commit Message**: `test(agents): add Behave feature file covering agents module behaviour` - **Milestone**: v3.7.0 - **Parent Epic**: #933 ## Background and Context The `src/cleveragents/agents/` module contains the following sub-modules and public classes (confirmed via source inspection): - `base` — Abstract `Agent` base class and `AgentWithMemory` mixin (observable message processing, capability introspection, lifecycle management) - `graphs/auto_debug` — `AutoDebugAgent` / `AutoDebugState` (LangGraph-based error analysis → fix generation → fix validation workflow) - `graphs/context_analysis` — `ContextAnalysisAgent` / `ContextAnalysisState` (file loading → dependency analysis → chunking → relevance scoring → summarisation) - `graphs/plan_generation` — `PlanGenerationGraph` / `PlanGenerationState` (prompt → context load → requirements analysis → plan generation → validation workflow) Per the project specification (ADR-011, §Architecture), all LangGraph-based agent workflows are the core execution engine of the CleverAgents platform. Every public behaviour of the `agents` module must be covered by Behave acceptance tests so that regressions in the agent execution pipeline are caught before they reach production. A scan of `/features/` confirms that **no `.feature` file currently targets the core `agents` module** — `agent_skills_loader.feature` covers only the skills loader sub-system, leaving the base agent abstractions and all three LangGraph graph agents entirely untested at the BDD acceptance level. ## Expected Behaviour A `features/agents.feature` file (and any necessary step definitions in `features/steps/`) should exist that exercises the public API of each `agents` sub-module, including: - `Agent` base class instantiation, configuration, and capability introspection - `Agent.process_message_sync` — synchronous message processing pipeline - `Agent.send_message` / `subscribe_to_output` / `create_observable` — reactive observable interface - `Agent.get_metadata` — metadata retrieval - `Agent.dispose` — lifecycle teardown - `AgentWithMemory` — memory-augmented agent construction - `AutoDebugAgent.invoke` — synchronous error analysis and fix generation (happy path and retry scenarios) - `AutoDebugAgent.stream` — streaming execution of the debug workflow - `ContextAnalysisAgent.invoke` — synchronous context analysis (happy path and empty-file edge cases) - `ContextAnalysisAgent.stream` — streaming context analysis - `PlanGenerationGraph.invoke` — synchronous plan generation (happy path and validation-retry scenarios) - `PlanGenerationGraph.stream` — streaming plan generation - Lazy-load `__getattr__` on the `agents` package — correct resolution of all exported names All LLM interactions must be mocked using `FakeListLLM` (or equivalent) placed in `features/mocks/` per the project mocking policy. ## Subtasks - [ ] Audit each `agents` sub-module (`base`, `graphs/auto_debug`, `graphs/context_analysis`, `graphs/plan_generation`) and list all public behaviours to be covered - [ ] Write `features/agents.feature` with Gherkin scenarios for each identified behaviour - [ ] Add mock LLM fixtures (e.g. `FakeListLLM` wrappers) to `features/mocks/` as required - [ ] Implement any missing step definitions in `features/steps/` - [ ] Run `nox -s behave` locally and confirm all new scenarios pass - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions) and fix any errors ## 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 (`test(agents): add Behave feature file covering agents module behaviour`), followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly (`test/agents-behave-feature`). - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass. - Coverage >= 97%. --- **Automated by CleverAgents Bot** Supervisor: Unknown | Agent: ca-new-issue-creator
freemo added this to the v3.7.0 milestone 2026-04-04 19:27:30 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified | MoSCoW: Should Have — Missing Behave feature file for the agents module. Test coverage is a project requirement (≥97%).

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

Issue triaged by project owner: - **State**: Verified | **MoSCoW**: Should Have — Missing Behave feature file for the agents module. Test coverage is a project requirement (≥97%). --- **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#2783
No description provided.