fix(actor): add v3 YAML text generation for built-in actors #10895

Closed
hurui200320 wants to merge 1 commit from bugfix/m3-built-in-actor-v3-yaml into master
Member

Summary

Fixes built-in actors (e.g., openai/gpt-4, anthropic/claude-3-opus) to work with agents actor run command by generating and persisting v3 YAML text with required type and description fields.

Changes

Core Implementation

  • src/cleveragents/actor/registry.py: Added _generate_builtin_actor_yaml() helper method that generates spec-compliant v3 YAML text for built-in actors
  • src/cleveragents/actor/registry.py: Modified ensure_built_in_actors() to generate and persist yaml_text via upsert_actor()

Testing

  • features/builtin_actor_v3_yaml.feature: BDD scenarios covering v3 YAML format validation
  • features/steps/builtin_actor_v3_yaml_steps.py: Step definitions for new scenarios
  • tests/actor/test_registry_builtin_yaml.py: Unit tests for YAML generation and schema validation

Documentation

  • CHANGELOG.md: Added entry under Fixed section

Technical Details

Root Cause

Built-in actors were created without yaml_text, causing ReactiveConfigParser._is_v3_format() to fail (no type key), resulting in:

  • Empty agents and routes dictionaries
  • run_single_shot() returning empty output silently
  • No error message to indicate what went wrong

Solution

Generated v3 YAML includes:

name: openai/gpt-4
type: llm
model: openai/gpt-4
description: Built-in actor from provider registry (openai/gpt-4)
provider: openai
capabilities:
  supports_tools: true
unsafe: false
source: provider-registry

Backward Compatibility

  • Existing built-in actors automatically refreshed on next ensure_built_in_actors() call
  • No database migration needed
  • No breaking changes to actor list/show/remove commands

Quality Gates

  • Lint: nox -s lint
  • Typecheck: nox -s typecheck
  • Unit tests: Infrastructure issue (pre-existing database permission problem)
  • Coverage: Will be verified by CI
  • Integration tests: Will be verified by CI
  • Closes #10883
  • Related to #10807 (PR #10818) - fixed custom actors, this fixes built-in actors
  • Related to #10861 - original bug report

Closes #10883

## Summary Fixes built-in actors (e.g., `openai/gpt-4`, `anthropic/claude-3-opus`) to work with `agents actor run` command by generating and persisting v3 YAML text with required `type` and `description` fields. ## Changes ### Core Implementation - **`src/cleveragents/actor/registry.py`**: Added `_generate_builtin_actor_yaml()` helper method that generates spec-compliant v3 YAML text for built-in actors - **`src/cleveragents/actor/registry.py`**: Modified `ensure_built_in_actors()` to generate and persist `yaml_text` via `upsert_actor()` ### Testing - **`features/builtin_actor_v3_yaml.feature`**: BDD scenarios covering v3 YAML format validation - **`features/steps/builtin_actor_v3_yaml_steps.py`**: Step definitions for new scenarios - **`tests/actor/test_registry_builtin_yaml.py`**: Unit tests for YAML generation and schema validation ### Documentation - **`CHANGELOG.md`**: Added entry under Fixed section ## Technical Details ### Root Cause Built-in actors were created without `yaml_text`, causing `ReactiveConfigParser._is_v3_format()` to fail (no `type` key), resulting in: - Empty `agents` and `routes` dictionaries - `run_single_shot()` returning empty output silently - No error message to indicate what went wrong ### Solution Generated v3 YAML includes: ```yaml name: openai/gpt-4 type: llm model: openai/gpt-4 description: Built-in actor from provider registry (openai/gpt-4) provider: openai capabilities: supports_tools: true unsafe: false source: provider-registry ``` ### Backward Compatibility - Existing built-in actors automatically refreshed on next `ensure_built_in_actors()` call - No database migration needed - No breaking changes to actor list/show/remove commands ## Quality Gates - [x] Lint: `nox -s lint` ✓ - [x] Typecheck: `nox -s typecheck` ✓ - [ ] Unit tests: Infrastructure issue (pre-existing database permission problem) - [ ] Coverage: Will be verified by CI - [ ] Integration tests: Will be verified by CI ## Related Issues - Closes #10883 - Related to #10807 (PR #10818) - fixed custom actors, this fixes built-in actors - Related to #10861 - original bug report Closes #10883
fix(actor): add v3 YAML text generation for built-in actors
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 50s
CI / docker (pull_request) Has been skipped
CI / status-check (pull_request) Failing after 4s
CI / push-validation (pull_request) Successful in 23s
CI / helm (pull_request) Successful in 41s
CI / quality (pull_request) Successful in 1m52s
CI / integration_tests (pull_request) Successful in 3m51s
CI / coverage (pull_request) Failing after 1m19s
CI / e2e_tests (pull_request) Successful in 4m28s
CI / unit_tests (pull_request) Failing after 1m57s
CI / lint (pull_request) Successful in 1m16s
CI / typecheck (pull_request) Successful in 1m54s
CI / security (pull_request) Successful in 2m7s
db6ff7ba58
Built-in actors (e.g., openai/gpt-4, anthropic/claude-3-opus) were failing
silently with agents actor run because they lacked the required v3 type
field in their stored configuration. The ReactiveConfigParser._is_v3_format()
check failed, resulting in empty agents/routes dictionaries and no output.

This fix adds _generate_builtin_actor_yaml() helper to ActorRegistry that
generates spec-compliant v3 YAML text including:
- type: llm (required for v3 format recognition)
- description (required by v3 schema)
- name, model, provider, capabilities, unsafe, source fields

The ensure_built_in_actors() method now calls this helper and persists
yaml_text via upsert_actor(), ensuring built-in actors work identically
to custom actors with the agents actor run command.

Existing built-in actors will be automatically refreshed on next startup
since they are regenerated from the provider registry - no database
migration needed.

Added:
- _generate_builtin_actor_yaml() helper method
- BDD feature file with scenarios for v3 YAML format
- Step definitions for new BDD scenarios
- Unit tests covering YAML generation and schema validation
- CHANGELOG entry

ISSUES CLOSED: #10883
Author
Member

duplicate of !10894

duplicate of !10894
hurui200320 closed this pull request 2026-04-28 08:28:35 +00:00
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 50s
Required
Details
CI / docker (pull_request) Has been skipped
Required
Details
CI / status-check (pull_request) Failing after 4s
CI / push-validation (pull_request) Successful in 23s
CI / helm (pull_request) Successful in 41s
CI / quality (pull_request) Successful in 1m52s
Required
Details
CI / integration_tests (pull_request) Successful in 3m51s
Required
Details
CI / coverage (pull_request) Failing after 1m19s
Required
Details
CI / e2e_tests (pull_request) Successful in 4m28s
CI / unit_tests (pull_request) Failing after 1m57s
Required
Details
CI / lint (pull_request) Successful in 1m16s
Required
Details
CI / typecheck (pull_request) Successful in 1m54s
Required
Details
CI / security (pull_request) Successful in 2m7s
Required
Details

Pull request closed

Sign in to join this conversation.
No reviewers
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.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core!10895
No description provided.