test(actor): add regression test for issue 4321 nested config extraction #11126

Merged
CoreRasurae merged 1 commits from fix/actor-registry-provider-extraction into master 2026-05-12 13:03:03 +00:00
3 changed files with 31 additions and 0 deletions
+7
View File
@@ -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.<name>.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.
5
@@ -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
@@ -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 = (