Files
cleveragents-core/features/builtin_actor_v3_yaml.feature
hurui200320 caf146e132
CI / benchmark-publish (push) Failing after 39s
CI / helm (push) Successful in 38s
CI / build (push) Successful in 54s
CI / lint (push) Successful in 1m2s
CI / push-validation (push) Successful in 21s
CI / quality (push) Successful in 1m26s
CI / typecheck (push) Successful in 1m46s
CI / security (push) Successful in 1m51s
CI / integration_tests (push) Successful in 4m16s
CI / unit_tests (push) Successful in 4m56s
CI / e2e_tests (push) Successful in 4m56s
CI / docker (push) Successful in 1m49s
CI / coverage (push) Successful in 10m51s
CI / status-check (push) Successful in 3s
CI / benchmark-publish (pull_request) Has been skipped
CI / coverage (pull_request) Successful in 14m50s
CI / docker (pull_request) Successful in 1m58s
CI / quality (pull_request) Successful in 1m18s
CI / e2e_tests (pull_request) Successful in 3m53s
CI / integration_tests (pull_request) Successful in 6m34s
CI / unit_tests (pull_request) Successful in 8m47s
CI / push-validation (pull_request) Successful in 20s
CI / lint (pull_request) Successful in 1m19s
CI / typecheck (pull_request) Successful in 1m26s
CI / security (pull_request) Successful in 1m31s
CI / helm (pull_request) Successful in 36s
CI / build (pull_request) Successful in 43s
CI / status-check (pull_request) Successful in 5s
fix(actor): resolve provider from explicit field in v3 YAML before inferring from model
Two bugs prevented built-in LLM actors from working with models that lack a '/'
separator (e.g. claude-sonnet-4-20250514):

1. _generate_builtin_actor_yaml (actor/registry.py) was constructing the model
   field as '{provider}/{model}' (e.g. 'anthropic/claude-sonnet-4-20250514').
   The Anthropic API expects just the bare model ID, causing 404 errors. Fixed
   by using the bare model identifier and lowercasing the provider field to
   match ProviderType enum values.

2. _build_from_v3 (reactive/config_parser.py) always inferred the provider from
   the model string via infer_provider_from_model(). For models without a '/'
   separator this returned 'custom', an invalid ProviderType, causing
   'Unknown provider type: custom' at runtime. Fixed by checking for an
   explicit top-level 'provider' field in the v3 YAML data (per spec resolution
   order step 2) before falling back to inference.

As a side effect, these fixes also resolve issue #10861: agents actor run now
successfully invokes the LLM when using built-in actors. The @tdd_expected_fail
tag has been removed from features/tdd_actor_run_response.feature accordingly.

New BDD scenarios added to features/builtin_actor_v3_yaml.feature and
features/actor_v3_route_synthesis.feature validate both fixes and the fallback
inference behaviour for models with '/' separators.

All quality gates pass: lint, typecheck, 671 feature files (15673 scenarios),
1997 Robot integration tests, coverage 97.12%.

ISSUES CLOSED: #10926
2026-04-30 02:05:12 +00:00

57 lines
2.8 KiB
Gherkin

Feature: Built-in actors work with v3 YAML format
As a developer
I want built-in actors to include v3 YAML text with type field
So that agents actor run works identically for built-in and custom actors
Scenario: Built-in actor YAML includes type field
Given a configured provider registry with openai/gpt-4
When built-in actors are ensured
Then the openai/gpt-4 actor should have yaml_text
And the yaml_text should contain "type: llm"
And the yaml_text should contain "description:"
Scenario: Built-in actor YAML includes required v3 fields
Given a configured provider registry with anthropic/claude-3-opus
When built-in actors are ensured
Then the anthropic/claude-3-opus actor yaml_text should contain "name:"
And the yaml_text should contain "type: llm"
And the yaml_text should contain "model:"
And the yaml_text should contain "provider:"
And the yaml_text should contain "source: provider-registry"
Scenario: Built-in actor works with agents actor run command
Given a configured provider registry with openai/gpt-4
And the built-in actors have been ensured
When I call agents actor run with mock "openai/gpt-4"
Then the command should not fail with v3 format error
And the config parser should recognize the actor as v3 format
Scenario: Built-in actor YAML structure matches v3 schema
Given a configured provider registry with openai/gpt-4
When built-in actors are ensured
Then the generated yaml_text should be valid v3 ActorConfigSchema
And the yaml_text should parse without errors
@tdd_issue @tdd_issue_10926
Scenario: Built-in actor YAML uses bare model identifier without provider prefix
Given a configured provider registry with anthropic/claude-sonnet-4-20250514
When built-in actors are ensured
Then the anthropic/claude-sonnet-4-20250514 actor should have yaml_text
And the yaml_text should contain "model: claude-sonnet-4-20250514"
And the yaml_text should not contain "model: anthropic/claude-sonnet-4-20250514"
@tdd_issue @tdd_issue_10926
Scenario: Built-in actor YAML has lowercase provider field
Given a configured provider registry with Anthropic/claude-sonnet-4-20250514
When built-in actors are ensured
Then the yaml_text should contain "provider: anthropic"
And the yaml_text should not contain "provider: Anthropic"
@tdd_issue @tdd_issue_10926
Scenario: Built-in actor YAML for model without slash has separate provider and model fields
Given a configured provider registry with anthropic/claude-sonnet-4-20250514
When built-in actors are ensured
Then the generated yaml_text should be valid v3 ActorConfigSchema
And the yaml_text should contain "provider: anthropic"
And the yaml_text should contain "model: claude-sonnet-4-20250514"