Fix actor add --config crash with combined-format config.actor (#11189) #11232
No reviewers
Labels
No labels
auto/needs-reevaluation
controller-managed
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cleveragents/cleveragents-core!11232
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-11189-config-actor-format"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes actor registration crash when using the spec-compliant combined
config.actorformat.Problem
Users running
agents actor add --config ./actor.yamlwith a YAML file using combined-format config.actor crashed with "Invalid value: 'provider' is required" because the parser never flattened the nested structure.Solution (three-layer defense)
schema.py::_detect_nested_config_actor): Recognizes both compact string form and nested dict ofconfig.actor.actor.py: add()): Merges config["actor"] fields into the top-level blob before downstream processing.config.py::from_blob()+_extract_v3_actor()): Flattens at the model level with priority: (1) config-actor, (2) top-level type, (3) actors map fallback.Changes
src/cleveragents/actor/schema.py: Added 3 new functions, extended is_v3_yaml()src/cleveragents/actor/config.py: Reworked from_blob() and _extract_v3_actor()src/cleveragents/cli/commands/actor.py: Added flattening steptests/actor/test_config_actor_combined_format.py: 20 test casesfeatures/actor_add_combined_config_format.feature: BDD scenariosCloses: #11189
Closes #11189
When users register actors via `agents actor add --config` using the spec-compliant combined config.actor YAML format — either as a compact string (config:\n actor: "<provider>/<model>") or as a nested dict (config:\n actor:\n type: llm\n provider: aws) — the CLI crashed with click.BadParameter: "Invalid value: 'provider' is required" because the parser did not detect or flatten the nested structure. Added: - _detect_nested_config_actor() in schema.py to recognise both compact-string and nested-dict forms of config-actor format. - _flatten_config_actor() in schema.py to merge config["actor"] fields into the dict top-level (removing the wrapper). - Flattening logic in ActorConfiguration.from_blob() to handle both string ("<provider>/<model>") and nested-dict forms of config.actor. - CLI flattening step at the start of `agents actor add` command. - New BDD scenarios for combined-format registration. - Unit tests for detection, flattening, schema-v3 detection, and full from_blob() flow. ISSUES CLOSED: #11189CI Checks Required
No CI checks have been reported as passing for this PR. Per company policy, all CI gates (lint, typecheck, security_scan, unit_tests, coverage_report) must pass before a PR can be approved and merged.
Please ensure the following CI checks are configured and passing before resubmission for review:
lint— ruff linting + format checktypecheck— Pyright strict type checking (zero # type: ignore tolerated)security_scan— bandit + semgrep + vultureunit_tests— Behave BDD tests in features/coverage_report— Slipcover coverage measurement (must be >= 97%)Note: A full code review will be conducted once CI checks are in place. This PR is currently blocked by CI gate failure.
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker
ca7668befa728b68f034728b68f03432a23f32a6Lint (ruff): - schema.py: import `cast`, replace non-breaking hyphens, inline SIM103 return, wrap long is_nested_v3 line - config.py: replace `if k in d: del d[k]` with `pop`, collapse nested ifs (SIM102) - format both reformatted-only files (ruff format) Typecheck (pyright): - config.py: guard `actor_type.lower()` calls with isinstance checks so the None branch is type-safe Unit tests (behave): - Remove duplicate `@then('v3actor the command ...')` and `@then('the actor should be registered with type ...')` registrations that crashed step-registry with AmbiguousStep — shared versions live in actor_add_v3_schema_validation_steps.py - Add missing Actor import; drop unused ActorConfiguration / is_v3_yaml imports and unused provider/model locals - Populate `context.registered_actor_type` from the upsert call args so the shared assertion step works for combined-format scenarios - Add a `@when("I run the actor add command without a name argument")` step that exercises the CLI's "Actor name is required" validation path (the previously-active step always supplied a name, masking the scenario's intent) ISSUES CLOSED: #11189Coverage (96.5% threshold) was failing because the prior implementation of `_extract_v3_actor` and `_extract_config_actor` contained unreachable code that the test suite could not exercise. schema.py — remove `_extract_config_actor()`. The function was defined but never called. `_detect_nested_config_actor` + `_flatten_config_actor` (both used by `cli/commands/actor.py`) cover all real call sites. config.py — remove the `if isinstance(config_block, dict):` branch in `_extract_v3_actor`. `from_blob` already flattens `config.actor` and pops the `config` key BEFORE calling `_extract_v3_actor` (lines 207-221), so `data.get("config")` always returns None and the branch is dead. Net: -88 LoC, no semantic change (the dead code never executed). The existing BDD scenarios in `features/actor_add_combined_config_format.feature` continue to pass unchanged. ISSUES CLOSED: #11189Claimed by
merge_drive.py(pid 1264876) until2026-05-29T03:44:06.129786+00:00.This claim is advisory and will be released when the cycle ends, or after the TTL by a sibling driver's expired-claim sweep.
Approved by the controller reviewer stage (workflow 23).