Files
cleveragents-core/features/actor_config_coverage_boost.feature
hurui200320 d512123d1c fix(actor): support v3 Actor YAML schema in CLI registration and execution
The actor CLI was ignoring the v3 ActorConfigSchema format, preventing
spec-compliant actors with type/route/skills/lsp fields from being
registered or executed.  Three components were fixed:

ActorConfiguration.from_blob() now detects v3 format (top-level "type"
key with value llm/graph/tool) and extracts provider from the model
string, falling through to v2 extraction when v3 does not match.

ActorRegistry.add() now routes v3 YAML through full ActorConfigSchema
validation, persists description/skills/lsp in the config blob, and
compiles graph actors with compile_actor() storing metadata.  Legacy v2
YAML continues through the original path unchanged.

ReactiveConfigParser._build() now synthesises reactive agents and graph
routes from v3 actor data so that agents actor run can execute v3 actors
through the existing ReactiveCleverAgentsApp pipeline.

ISSUES CLOSED: #6283
2026-04-27 05:00:54 +00:00

42 lines
2.1 KiB
Gherkin

Feature: ActorConfiguration.load_yaml_text and defensive paths
Coverage-boost scenarios targeting uncovered lines in actor/config.py
# --- load_yaml_text: JSON null input (lines 50-51) ---
Scenario: load_yaml_text returns empty dict for JSON null
When I call load_yaml_text with "null"
Then the load_yaml_text result should be an empty dict
# --- load_yaml_text: JSON non-dict input (lines 52-53) ---
Scenario: load_yaml_text raises ValueError for a JSON string
When I call load_yaml_text with a JSON string value
Then a ValueError with message containing "object" should be raised
Scenario: load_yaml_text raises ValueError for a JSON array
When I call load_yaml_text with a JSON array value
Then a ValueError with message containing "object" should be raised
Scenario: load_yaml_text raises ValueError for a JSON integer
When I call load_yaml_text with a JSON integer value
Then a ValueError with message containing "object" should be raised
# --- load_yaml_text: valid JSON dict (line 54) ---
Scenario: load_yaml_text returns parsed dict for valid JSON object
When I call load_yaml_text with '{"provider": "openai", "model": "gpt-4"}'
Then the load_yaml_text result should have key "provider" equal to "openai"
And the load_yaml_text result should have key "model" equal to "gpt-4"
Scenario: load_yaml_text returns parsed dict for empty JSON object
When I call load_yaml_text with '{}'
Then the load_yaml_text result should be an empty dict
# --- load_yaml_text: YAML fallback path ---
Scenario: load_yaml_text falls back to YAML for non-JSON input
When I call load_yaml_text with YAML text "provider: openai\nmodel: gpt-4\n"
Then the load_yaml_text result should have key "provider" equal to "openai"
# --- load_yaml_text: interpolation returns non-dict (line 89) ---
Scenario: load_yaml_text raises ValueError when interpolation returns non-dict
Given interpolate_env_vars is patched to return a list
When I call load_yaml_text with valid YAML via patched interpolation
Then a ValueError with message containing "object" should be raised