test(actors): fix actor examples missing provider fields and incorrect name
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 18s
CI / lint (pull_request) Failing after 18s
CI / helm (pull_request) Successful in 24s
CI / typecheck (pull_request) Failing after 52s
CI / security (pull_request) Failing after 53s
CI / coverage (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Has been skipped
CI / unit_tests (pull_request) Failing after 1m48s
CI / docker (pull_request) Has been skipped
CI / quality (pull_request) Successful in 3m42s
CI / e2e_tests (pull_request) Failing after 13m56s
CI / integration_tests (pull_request) Failing after 21m12s
CI / status-check (pull_request) Failing after 2s
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 18s
CI / lint (pull_request) Failing after 18s
CI / helm (pull_request) Successful in 24s
CI / typecheck (pull_request) Failing after 52s
CI / security (pull_request) Failing after 53s
CI / coverage (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Has been skipped
CI / unit_tests (pull_request) Failing after 1m48s
CI / docker (pull_request) Has been skipped
CI / quality (pull_request) Successful in 3m42s
CI / e2e_tests (pull_request) Failing after 13m56s
CI / integration_tests (pull_request) Failing after 21m12s
CI / status-check (pull_request) Failing after 2s
Add missing provider: field to all actor examples in examples/actors/. Fix llm_with_tools.yaml actor name from assistants/file_analyzer to local/assistants-file_analyzer (custom actors must use local/ namespace and cannot contain two slashes). Add validate-all command to helper_actor_examples.py that uses ActorLoader to validate all examples via business logic checks. Add integration test Validate All Actor Examples Import Without Errors to actor_examples.robot that confirms every example in examples/actors/ can be imported without errors. ISSUES CLOSED: #1504
This commit is contained in:
@@ -7,6 +7,7 @@ description: Runs a code review and merges to make the best possible.
|
||||
version: "0.0"
|
||||
|
||||
# LLM model form is Claude Opus 4
|
||||
provider: anthropic
|
||||
model: claude-opus-4-20250514
|
||||
|
||||
system_prompt: |
|
||||
|
||||
@@ -6,6 +6,7 @@ type: llm
|
||||
description: Generates pre-execution effort, duration, and risk estimates for implementation planning
|
||||
version: "1.0"
|
||||
|
||||
provider: openai
|
||||
model: gpt-4
|
||||
role_hint: estimation
|
||||
context_view: strategist
|
||||
|
||||
@@ -7,6 +7,7 @@ description: Test-driven development workflow with automated testing and feedbac
|
||||
version: "1.0"
|
||||
|
||||
# LLM model for agent nodes
|
||||
provider: openai
|
||||
model: gpt-4
|
||||
|
||||
# Graph topology
|
||||
|
||||
@@ -8,6 +8,7 @@ description: >-
|
||||
Multi-agent development workflow with a strategist, implementer, and
|
||||
reviewer. Each node has fine-grained LSP and tool-source control.
|
||||
version: "1.0"
|
||||
provider: openai
|
||||
model: gpt-4
|
||||
|
||||
# Actor-level skill references
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
# LLM Actor with Tools
|
||||
# Demonstrates an LLM actor with access to multiple tools
|
||||
|
||||
name: assistants/file_analyzer
|
||||
name: local/assistants-file_analyzer
|
||||
type: llm
|
||||
description: Analyzes files and generates reports using file system tools
|
||||
version: "1.0"
|
||||
|
||||
# LLM configuration
|
||||
provider: openai
|
||||
model: gpt-4-turbo
|
||||
system_prompt: |
|
||||
You are a file analysis assistant. Use the available tools to:
|
||||
|
||||
@@ -7,6 +7,7 @@ description: Simple document processing workflow (extract → analyze → summar
|
||||
version: "1.0"
|
||||
|
||||
# LLM model
|
||||
provider: openai
|
||||
model: gpt-3.5-turbo
|
||||
|
||||
# Graph topology
|
||||
|
||||
@@ -7,6 +7,7 @@ description: Reviews Python code for best practices, style, and potential bugs
|
||||
version: "1.0"
|
||||
|
||||
# LLM configuration
|
||||
provider: openai
|
||||
model: gpt-4
|
||||
system_prompt: |
|
||||
You are an expert Python code reviewer. Review code for:
|
||||
|
||||
@@ -18,6 +18,7 @@ description: >
|
||||
using the builtin/plan-subplan tool.
|
||||
version: "1.0"
|
||||
|
||||
provider: openai
|
||||
model: gpt-4-turbo
|
||||
context_view: strategist
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ Validate LLM With Tools Example
|
||||
Should Be Equal As Integers ${result.rc} 0
|
||||
Should Contain ${result.stdout} actor-ok
|
||||
Should Contain ${result.stdout} type:llm
|
||||
Should Contain ${result.stdout} name:local/assistants-file_analyzer
|
||||
Should Contain ${result.stdout} has-tools
|
||||
|
||||
Validate Estimator Example
|
||||
@@ -176,3 +177,22 @@ Reject GRAPH Actor Without Route
|
||||
Should Be Equal As Integers ${result.rc} 0
|
||||
Should Contain ${result.stdout} expected-fail
|
||||
Should Contain ${result.stdout} route
|
||||
|
||||
Validate All Actor Examples Import Without Errors
|
||||
[Documentation] Validate that all actor examples in examples/actors/ can be
|
||||
... imported without errors using ActorLoader business logic checks.
|
||||
... This is the integration test required by issue #1504 Definition of Done.
|
||||
[Tags] slow
|
||||
${result}= Run Process ${PYTHON} ${HELPER} validate-all ${EXAMPLES_DIR} cwd=${WORKSPACE}
|
||||
Log ${result.stdout}
|
||||
Log ${result.stderr}
|
||||
Should Be Equal As Integers ${result.rc} 0
|
||||
Should Contain ${result.stdout} all-examples-ok:
|
||||
Should Contain ${result.stdout} actor-imported:local/assistants-file_analyzer
|
||||
Should Contain ${result.stdout} actor-imported:local/strategy_with_subplan
|
||||
Should Contain ${result.stdout} actor-imported:local/estimator
|
||||
Should Contain ${result.stdout} actor-imported:local/code-review
|
||||
Should Contain ${result.stdout} actor-imported:utilities/file_operations
|
||||
Should Contain ${result.stdout} actor-imported:workflows/document_processor
|
||||
Should Contain ${result.stdout} actor-imported:workflows/test_driven_dev
|
||||
Should Contain ${result.stdout} actor-imported:workflows/dev-workflow
|
||||
|
||||
@@ -10,6 +10,7 @@ Usage:
|
||||
python robot/helper_actor_examples.py check-pattern <yaml_file> <pattern>
|
||||
python robot/helper_actor_examples.py check-docs <doc_file>
|
||||
python robot/helper_actor_examples.py check-doc-patterns <doc_file>
|
||||
python robot/helper_actor_examples.py validate-all <directory>
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -22,6 +23,7 @@ _SRC = str(Path(__file__).resolve().parents[1] / "src")
|
||||
if _SRC not in sys.path:
|
||||
sys.path.insert(0, _SRC)
|
||||
|
||||
from cleveragents.actor.loader import ActorLoader # noqa: E402
|
||||
from cleveragents.actor.schema import ActorConfigSchema, ActorType # noqa: E402
|
||||
|
||||
|
||||
@@ -189,6 +191,27 @@ def check_doc_patterns(doc_file: str) -> int:
|
||||
return 1
|
||||
|
||||
|
||||
def validate_all_examples(directory: str) -> int:
|
||||
"""Validate all actor examples in a directory via ActorLoader business logic.
|
||||
|
||||
Uses ActorLoader (which applies ActorConfigSchema validation) to discover
|
||||
and validate every YAML file in the given directory. Prints one
|
||||
``actor-imported:<name>`` line per successfully loaded actor and a final
|
||||
``all-examples-ok:<count>`` summary line. Returns 1 on any failure.
|
||||
"""
|
||||
try:
|
||||
examples_dir = Path(directory)
|
||||
loader = ActorLoader(search_roots=[examples_dir])
|
||||
actors = loader.discover()
|
||||
for actor in actors:
|
||||
print(f"actor-imported:{actor.name}")
|
||||
print(f"all-examples-ok:{len(actors)}")
|
||||
return 0
|
||||
except Exception as exc:
|
||||
print(f"validate-all-fail: {exc}")
|
||||
return 1
|
||||
|
||||
|
||||
def main() -> int:
|
||||
"""Entry point called by Robot Framework ``Run Process``."""
|
||||
if len(sys.argv) < 2:
|
||||
@@ -200,7 +223,8 @@ def main() -> int:
|
||||
" count-examples <directory>\n"
|
||||
" check-pattern <file> <pattern>\n"
|
||||
" check-docs <doc_file>\n"
|
||||
" check-doc-patterns <doc_file>"
|
||||
" check-doc-patterns <doc_file>\n"
|
||||
" validate-all <directory>"
|
||||
)
|
||||
return 1
|
||||
|
||||
@@ -242,6 +266,12 @@ def main() -> int:
|
||||
return 1
|
||||
return check_doc_patterns(sys.argv[2])
|
||||
|
||||
if command == "validate-all":
|
||||
if len(sys.argv) < 3:
|
||||
print("Usage: validate-all <directory>")
|
||||
return 1
|
||||
return validate_all_examples(sys.argv[2])
|
||||
|
||||
print(f"Unknown command: {command}")
|
||||
return 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user