fix(runtime): validate agent configuration in Executor before agent creation #139
No reviewers
Labels
No labels
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.
Blocks
#122 Executor never calls AgentFactory.validate_configuration(), so malformed agents.<name> entries fail silently
cleveragents/cleveractors-core
Reference
cleveragents/cleveractors-core!139
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "bugfix/m1-executor-validate-configuration"
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
Executor.init / create_executor never called AgentFactory.validate_configuration(), unlike ReactiveCleverAgentsApp.load_configuration(), which already does. A malformed agents. entry (missing "type", or a non-mapping value) silently defaulted to an empty type: llm agent instead of being rejected up front (docs/index.md §11), surfacing only as an unrelated "missing credentials for provider: openai" error several layers into agent creation.
Fixed by validating the agents. section against a throwaway AgentFactory instance at the end of Executor.init, before any agent is created or any credential/provider lookup is attempted. Reuses AgentFactorys existing validate_configuration() rather than duplicating its logic; ReactiveCleverAgentsApps behavior is unchanged.
The issue #122 regression scenario (added in #124/#127, tagged @tdd_issue @tdd_issue_122 @tdd_expected_fail) now passes normally; the @tdd_expected_fail tag has been removed. Its step definitions were updated to capture the ConfigurationError raised during Executor construction (the new, correct failure point) instead of during execute().
Closes #122
Test plan
PR Review: !139 (Ticket #122)
Verdict: Approve
The fix correctly closes the validation gap in
Executor.__init__by callingAgentFactory.validate_configuration()before any agent is instantiated, matching the requirement in issue #122. The implementation reuses existing validation logic, does not perform network I/O or credential lookups during validation, and leavesReactiveCleverAgentsAppunchanged. The regression scenario now passes without@tdd_expected_fail.No critical or major issues were found. The remaining items are minor test-coverage completeness and a small comment precision nit.
Critical Issues
None
Major Issues
None
Minor Issues
features/credential_executor_validation.feature(lines 30–36)type, (b) non-mappingagents.<name>value, and (c) typo’d-key case. The PR only updates the existing typo’d-key scenario. WhileAgentFactory.validate_configuration()itself is tested elsewhere (features/agent_package_references.feature,features/steps/agent_modules_steps.py), the Executor path is not explicitly covered for the missing-type and non-mapping cases.features/credential_executor_validation.featurethat construct anExecutorwithagents: {worker: {config: {}}}andagents: {worker: 123}, asserting the sameConfigurationErrorbehavior. This directly satisfies the ticket’s acceptance criteria without relying on indirect coverage.Nits
src/cleveractors/runtime.py(lines 137–144)agents.<name>is a mapping with a knowntype). It does not enforce route validation, merge/split validation, environment-variable validation, or the requirement thatagentsitself be present.agents.<name>section eagerly (docs/index.md §11.1–11.2 agent structural validation)" to avoid implying full §11 compliance.Summary
This is a focused, low-risk bugfix that addresses the root cause described in #122. The implementation is minimal and reuses the existing validator rather than duplicating logic. The test update correctly captures the new failure point during construction. I recommend approving after considering the minor test-coverage expansion and comment tweak, neither of which blocks functionality.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.