From f6ca9b729106c15eac4969f1956feaa2d8e92586 Mon Sep 17 00:00:00 2001 From: CoreRasurae Date: Mon, 11 May 2026 10:13:39 +0000 Subject: [PATCH] test(actor): add regression test for issue 4321 nested config extraction Add BDD regression test for Forgejo issue 4321: ActorRegistry.add() fails to extract provider and model from nested actor config. The test verifies that when type is only at the nested actors map level (not at top level), provider and model are correctly extracted from the nested config block. This scenario is already handled correctly by the _extract_nested_v3_config() function added in commit 78be0887 (issue #4300). The test confirms the fix works as expected and prevents future regressions. Tags: @tdd_issue @tdd_issue_4321 ISSUES CLOSED: #4321 --- CHANGELOG.md | 7 +++++++ features/actor_registry_spec_yaml.feature | 7 +++++++ .../steps/actor_registry_spec_yaml_steps.py | 17 +++++++++++++++++ 3 files changed, 31 insertions(+) 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 = ( -- 2.52.0