UAT: ActorRegistry.add() requires provider field not defined in v3 ActorConfigSchema #3415

Open
opened 2026-04-05 16:35:43 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/actor-registry-provider-field-schema-mismatch
  • Commit Message: fix(actor): remove undocumented provider requirement from ActorRegistry.add()
  • Milestone: (none — backlog)
  • Parent Epic: #392

Backlog note: This issue was discovered during autonomous operation
on milestone v3.2.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.

Background and Context

The ActorRegistry.add() method (the YAML-first actor registration path) enforces a hard requirement on a provider field that is not defined in the canonical v3 ActorConfigSchema. This creates a contradiction between the schema, the spec, and the runtime validation logic.

The v3 ActorConfigSchema (defined in src/cleveragents/actor/schema.py) defines the following fields:

  • name (required)
  • type (required: llm / tool / graph)
  • description (required)
  • model (required for LLM/GRAPH actors)
  • tools, skills, route, etc.

The spec's Actor Definition Fields table does not list provider as a top-level field. The provider field belongs to the legacy v2 format's config: block, not the v3 top-level schema.

The add() method currently enforces:

# src/cleveragents/actor/registry.py, lines 214-220
provider_raw = blob.get("provider") or blob.get("provider_type", "")
model_raw = blob.get("model") or blob.get("model_id", "")

if not provider_raw or not model_raw:
    raise ValidationError(
        "Actor YAML must include 'provider' and 'model' fields."
    )

The example files in examples/actors/ work around this by including provider: openai at the top level — a non-spec field — making them inconsistent with ActorConfigSchema.

Current Behavior

  1. ActorConfigSchema validates YAML without requiring provider.
  2. ActorRegistry.add() rejects YAML without provider, raising ValidationError.
  3. The spec's actor YAML format does not include provider at the top level.

Steps to reproduce:

  1. Create a v3-format actor YAML:
    version: "3"
    name: local/test
    type: llm
    model: gpt-4
    description: Test actor
    
  2. Call ActorRegistry.add(yaml_text) with this YAML.
  3. Observe: ValidationError: Actor YAML must include 'provider' and 'model' fields.

Expected Behavior

ActorRegistry.add() should accept v3-format YAML that is valid per ActorConfigSchema without requiring a provider field. The provider should be inferred from the model name or from the configured providers registry — consistent with the spec.

Acceptance Criteria

  • ActorRegistry.add() accepts v3-format YAML that passes ActorConfigSchema validation without a provider field
  • Provider is inferred from model name or configured providers when not explicitly supplied
  • ActorConfigSchema and ActorRegistry.add() are consistent in their field requirements
  • Example files in examples/actors/ conform to the v3 schema (no non-spec provider top-level field required)
  • The spec's Actor Definition Fields table is the authoritative reference; code matches it
  • All nox stages pass
  • Coverage >= 97%

Subtasks

  • Audit ActorRegistry.add() (src/cleveragents/actor/registry.py, lines ~214-220) and remove the hard provider requirement
  • Implement provider inference logic (from model name or configured providers registry)
  • Update ActorConfigSchema (src/cleveragents/actor/schema.py) if any schema/code gap remains
  • Update or remove the non-spec provider field from examples/actors/ YAML files
  • Write a TDD issue-capture Behave scenario (@tdd_expected_fail) demonstrating the bug before fixing it
  • Write unit tests (Behave/Gherkin) covering v3 YAML without provider field
  • Write integration tests (Robot Framework) for agents actor add with v3-format YAML
  • Verify all nox sessions pass (nox -e lint, nox -e typecheck, nox -e unit_tests, nox -e integration_tests, nox -e coverage_report)

Definition of Done

  • All subtasks above are checked
  • The correctly formatted commit (fix(actor): remove undocumented provider requirement from ActorRegistry.add()) is pushed to branch fix/actor-registry-provider-field-schema-mismatch
  • The corresponding pull request has been successfully merged
  • All nox stages pass
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-uat-tester

## Metadata - **Branch**: `fix/actor-registry-provider-field-schema-mismatch` - **Commit Message**: `fix(actor): remove undocumented provider requirement from ActorRegistry.add()` - **Milestone**: *(none — backlog)* - **Parent Epic**: #392 > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.2.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. ## Background and Context The `ActorRegistry.add()` method (the YAML-first actor registration path) enforces a hard requirement on a `provider` field that is **not defined** in the canonical v3 `ActorConfigSchema`. This creates a contradiction between the schema, the spec, and the runtime validation logic. The v3 `ActorConfigSchema` (defined in `src/cleveragents/actor/schema.py`) defines the following fields: - `name` (required) - `type` (required: `llm` / `tool` / `graph`) - `description` (required) - `model` (required for LLM/GRAPH actors) - `tools`, `skills`, `route`, etc. The spec's Actor Definition Fields table does **not** list `provider` as a top-level field. The `provider` field belongs to the legacy v2 format's `config:` block, not the v3 top-level schema. The `add()` method currently enforces: ```python # src/cleveragents/actor/registry.py, lines 214-220 provider_raw = blob.get("provider") or blob.get("provider_type", "") model_raw = blob.get("model") or blob.get("model_id", "") if not provider_raw or not model_raw: raise ValidationError( "Actor YAML must include 'provider' and 'model' fields." ) ``` The example files in `examples/actors/` work around this by including `provider: openai` at the top level — a non-spec field — making them inconsistent with `ActorConfigSchema`. ## Current Behavior 1. `ActorConfigSchema` validates YAML without requiring `provider`. 2. `ActorRegistry.add()` rejects YAML without `provider`, raising `ValidationError`. 3. The spec's actor YAML format does not include `provider` at the top level. **Steps to reproduce:** 1. Create a v3-format actor YAML: ```yaml version: "3" name: local/test type: llm model: gpt-4 description: Test actor ``` 2. Call `ActorRegistry.add(yaml_text)` with this YAML. 3. Observe: `ValidationError: Actor YAML must include 'provider' and 'model' fields.` ## Expected Behavior `ActorRegistry.add()` should accept v3-format YAML that is valid per `ActorConfigSchema` without requiring a `provider` field. The provider should be inferred from the model name or from the configured providers registry — consistent with the spec. ## Acceptance Criteria - [ ] `ActorRegistry.add()` accepts v3-format YAML that passes `ActorConfigSchema` validation without a `provider` field - [ ] Provider is inferred from model name or configured providers when not explicitly supplied - [ ] `ActorConfigSchema` and `ActorRegistry.add()` are consistent in their field requirements - [ ] Example files in `examples/actors/` conform to the v3 schema (no non-spec `provider` top-level field required) - [ ] The spec's Actor Definition Fields table is the authoritative reference; code matches it - [ ] All nox stages pass - [ ] Coverage >= 97% ## Subtasks - [ ] Audit `ActorRegistry.add()` (`src/cleveragents/actor/registry.py`, lines ~214-220) and remove the hard `provider` requirement - [ ] Implement provider inference logic (from model name or configured providers registry) - [ ] Update `ActorConfigSchema` (`src/cleveragents/actor/schema.py`) if any schema/code gap remains - [ ] Update or remove the non-spec `provider` field from `examples/actors/` YAML files - [ ] Write a TDD issue-capture Behave scenario (`@tdd_expected_fail`) demonstrating the bug before fixing it - [ ] Write unit tests (Behave/Gherkin) covering v3 YAML without `provider` field - [ ] Write integration tests (Robot Framework) for `agents actor add` with v3-format YAML - [ ] Verify all nox sessions pass (`nox -e lint`, `nox -e typecheck`, `nox -e unit_tests`, `nox -e integration_tests`, `nox -e coverage_report`) ## Definition of Done - [ ] All subtasks above are checked - [ ] The correctly formatted commit (`fix(actor): remove undocumented provider requirement from ActorRegistry.add()`) is pushed to branch `fix/actor-registry-provider-field-schema-mismatch` - [ ] The corresponding pull request has been successfully merged - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
#392 Epic: Actor YAML & Compiler
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3415
No description provided.