fix(actor): resolve provider from explicit field in v3 YAML before inferring from model #10930
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
2 participants
Notifications
Due date
No due date set.
Blocks
#10926 Fix v3 actor provider resolution for models without
/ separator
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core!10930
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "bugfix/m3-v3-actor-provider-resolution"
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?
Summary
Two bugs prevented built-in LLM actors from working with models that lack a
/separator (e.g.claude-sonnet-4-20250514):_generate_builtin_actor_yaml(actor/registry.py) was constructing themodelfield as{provider}/{model}, which caused 404 errors on the Anthropic API. Fixed to use the bare model identifier and lowercase the provider field to matchProviderTypeenum values._build_from_v3(reactive/config_parser.py) always inferred the provider from the model string. For bare model IDs without/, this returned"custom"(invalid), causingUnknown provider type: custom. Fixed by checking for an explicit top-levelproviderfield in the v3 YAML data per spec resolution order before falling back to inference.As a side effect, these fixes also resolve issue #10861:
agents actor runnow successfully invokes the LLM for built-in actors.Changes
src/cleveragents/actor/registry.py: In_generate_builtin_actor_yaml, use bare model identifier and lowercase provider.src/cleveragents/reactive/config_parser.py: In_build_from_v3, check explicitproviderfield before callinginfer_provider_from_model().features/builtin_actor_v3_yaml.feature: 3 new TDD scenarios for the registry fix.features/actor_v3_route_synthesis.feature: 3 new TDD scenarios for the config parser fix.features/steps/builtin_actor_v3_yaml_steps.py:should not containassertion step added.features/steps/actor_v3_route_synthesis_steps.py: NewGivensteps for explicit/no-provider configs.features/tdd_actor_run_response.feature: Removed@tdd_expected_fail(bug #10861 fixed).Quality Gates
Closes #10926
/separator #10926/separatorTested the branch locally, anthropic provider is working as expected with this PR.
96467032df920083f636920083f6363157f25bf13157f25bf10526ea4c5c@HAL9000 please review this PR
Review Summary
PR #10930 — fix(actor): resolve provider from explicit field in v3 YAML before inferring from model
Closes: #10926 (and side-effect fix for #10861)
Issues Addressed
All acceptance criteria from issue #10926 have been met:
_build_from_v3checks for explicitproviderfield before inferring from model_generate_builtin_actor_yamlgeneratesmodelas bare identifier (no provider prefix)_generate_builtin_actor_yamlgeneratesproviderin lowercase/in the model string continue to work via inference fallbackSpec Alignment
The provider resolution fix in
_build_from_v3correctly implements the spec resolution order (line 21412): CLI override → top-levelprovider/modelkeys →provider_type/model_idaliases → v2-extracted values. The explicit top-levelproviderfield is now checked as step 2 before falling back toinfer_provider_from_model().10-Category Review
Correctness ✅ — Both bug fixes are precisely targeted. The bare-model fix prevents 404s on Anthropic API; the explicit-provider fix prevents the
Unknown provider type: customcrash for models without/.Specification Alignment ✅ — Follows the provider/model resolution order defined in docs/specification.md at line 21412. The
ActorConfigSchema.providerfield (line 747) is respected as the spec requires.Test Quality ✅ — 6 well-named TDD scenarios (3 per component), covering: explicit provider without slash, inference from slash-containing model, and no-provider fallback to
custom. The TDD regression test for #10861 had@tdd_expected_failremoved. Coverage at 97.12% meets the ≥97% gate.Type Safety ✅ — All signatures annotated;
isinstance(explicit_provider, str)type guard used; no# type: ignorepresent.Readability ✅ — Clear variable names (
explicit_provider), descriptive scenario titles, comments referencing spec lines and issue numbers.Performance ✅ — No changes to algorithmic complexity; only a single dict lookup added.
Security ✅ — No new attack surface; no secrets/tokens introduced.
Code Style ✅ — SOLID principles followed; small focused changes; all files well under 500 lines; follows ruff conventions.
Documentation ✅ — Inline comments explain the spec-alignment (
# m11: Resolve provider per spec resolution order). PR body is comprehensive.Commit and PR Quality ✅ — PR description matches issue metadata; correct milestone (v3.2.0, milestone m3); one
Type/Buglabel; CI green across all 14 checks.Non-Blocking Suggestions
features/steps/tdd_actor_run_response_steps.pystill says "The @tdd_expected_fail tag inverts the result so CI passes while the bug exists." Consider adding a note that the tag was removed after the fix, for future maintainers.Verdict: APPROVED
All acceptance criteria met, all CI gates passing (lint, typecheck, security, unit_tests, integration_tests, coverage at 97.12%), code is correct and spec-aligned. Changes are minimal, well-tested, and focused.
Review completed: APPROVED ✅
All acceptance criteria met. Changes are correctly targeted, spec-aligned, and well-tested. Full review summary posted on the PR.
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker
0526ea4c5ccaf146e132hurui200320 referenced this pull request2026-04-30 13:22:41 +00:00
agents actor rundoes not work. #10861