diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b758fa6f..af2bf27e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,13 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). sets ``CLEVERAGENTS_CONFIG_PATH`` for ``ConfigService`` to pick up, and ``-v`` (repeatable count) maps to the appropriate ``structlog`` log level. +- **Add regression test for ActorRegistry.add() nested provider/model extraction** (#4321): + Added BDD regression test confirming that provider and model are correctly + extracted from nested `actors..config` blocks when `type` is only at + the nested level and `name` uses the `local/` namespace prefix. This + scenario was previously fixed in #4300; the test ensures the fix remains + in place and prevents future regressions. + - **Actor configuration validation incorrectly requires top-level provider field** (#4300): Actor configuration in V3 is now obtained from the nested configuration parameter, according to the specification. diff --git a/features/actor_registry_spec_yaml.feature b/features/actor_registry_spec_yaml.feature index b3443c090..a1f58d9ae 100644 --- a/features/actor_registry_spec_yaml.feature +++ b/features/actor_registry_spec_yaml.feature @@ -21,6 +21,13 @@ Feature: ActorRegistry.add() accepts spec-compliant actor YAML formats Then the actor should be registered with provider "anthropic" and model "claude-3" And the registered actor should exist in the actor service + @tdd_issue @tdd_issue_4321 @tdd_issue_4300 + Scenario: registry.add() with nested-only type extracts provider/model from nested config + When I add a YAML with type only in nested actors map and provider/model in nested config + Then the actor should be registered with provider "custom" and model "fpga-model" + And the registered actor name should be "local/fpga-strategist" + And the registered actor should exist in the actor service + # ── actors: map with unsafe flag ─────────────────────────────────── Scenario: registry.add() preserves unsafe flag from nested spec-compliant config diff --git a/features/steps/actor_registry_spec_yaml_steps.py b/features/steps/actor_registry_spec_yaml_steps.py index aefacc0cd..78a7e1696 100644 --- a/features/steps/actor_registry_spec_yaml_steps.py +++ b/features/steps/actor_registry_spec_yaml_steps.py @@ -143,6 +143,23 @@ def step_add_actors_separate(context: Context) -> None: context.spec_result = context.spec_registry.add(yaml_text) +@when( + "I add a YAML with type only in nested actors map and provider/model in nested config" +) +def step_add_nested_type_only(context: Context) -> None: + yaml_text = ( + "name: local/fpga-strategist\n" + "description: An FPGA strategist agent\n" + "actors:\n" + " fpga-strategist:\n" + " type: llm\n" + " config:\n" + " provider: custom\n" + " model: fpga-model\n" + ) + context.spec_result = context.spec_registry.add(yaml_text) + + @when("I add a spec-compliant YAML with actors map and unsafe flag") def step_add_actors_unsafe(context: Context) -> None: yaml_text = (