Executor never calls AgentFactory.validate_configuration(), so malformed agents.<name> entries fail silently #122
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 milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Depends on
#124 TDD: Executor never calls AgentFactory.validate_configuration(), so malformed agents.<name> entries fail silently
cleveragents/cleveractors-core
Reference
cleveragents/cleveractors-core#122
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Metadata
fix(runtime): validate agent configuration in Executor before agent creationfix/executor-validate-configurationBackground and context
AgentFactory.validate_configuration()(src/cleveractors/agents/factory.pyline ~503)already exists and does exactly what its name suggests: it walks
config["agents"]andraises a clear
ConfigurationErrorwhen an agent entry is not a mapping, or is a mappingmissing the required
"type"key. It is called from exactly one place:core/application.pyline 266, insideReactiveCleverAgentsApp.load_configuration().It is never called from
Executor.__init__/create_executor(src/cleveractors/runtime.pylines 77-131) — the documented (
docs/guides/reasoning-aware-llm-agents.md) direct entrypoint for constructing and running an executor.
AgentFactory.create_agent/_create_agent_instance(factory.pylines 176-300) have no equivalent guard of theirown: an agent entry with no
"type"key silently defaults totype: llm, and one withno
"config"key silently defaults toconfig: {}— i.e. a bare, empty LLM agent withevery field (provider, model, system_prompt, tools, ...) at its hardcoded default.
Current behavior
Related to, but distinct from, #121 (which covers
agent_template/package-referenceresolution not being implemented at all in this code path). Given a malformed agent
entry — for instance a typo'd key that isn't
"type"— passed directly tocreate_executor(perdocs/guides/reasoning-aware-llm-agents.md's documented usage):produces:
This is confusing and misleading: nothing about the actual problem — that
agents.workerhas no"type"key — is ever surfaced. Tracing it requires steppingthrough
AgentFactory.create_agent/_create_agent_instance/_instantiateby hand:agent_config.get("type", "llm")→ defaults to"llm"(no"type"key present).agent_config.get("config", {})→ defaults to{}(no"config"key present).LLMAgent'sself.provider = config.get("provider", "openai")(
agents/llm.pyline 306) → defaults to"openai".AgentFactory._instantiatelooks upself.credentials["openai"]; if the caller'scredentialsdict only has an entry for the intended provider (e.g."openai_compatible"), this raisesConfigurationError("missing credentials for provider: openai").The same silent-default behavior would equally mask a correctly-spelled but still
unresolved
agent_template:/template:key (see #121), or any other malformedagents.<name>entry — the credentials mismatch is only one of many confusing symptomsthis class of bug can produce.
Expected behavior
Executor.__init__(or the earliest practical point increate_executor) shouldvalidate the agent configuration — by calling
AgentFactory.validate_configuration()(orequivalent) — before any agent is created, so that a malformed
agents.<name>entry failsimmediately with a clear, actionable
ConfigurationError(e.g."Agent 'worker' must specify a type"), instead of silently defaulting to an emptytype: llmagent andsurfacing an unrelated error several layers downstream.
Acceptance criteria
Executor.__init__(or the earliest practical point increate_executor) invokesagent-configuration validation equivalent to
AgentFactory.validate_configuration().agents.<name>entry that is not a mapping, or is missing"type", raises aConfigurationErrornaming the offending agent, before any LLM/tool/network call isattempted.
ReactiveCleverAgentsApp's existing behavior is unchanged.an
Executorwith a malformedagents.<name>entry (e.g. a typo'd key) fails with avalidation error, not a downstream credentials error.
ExecutorraisesConfigurationErrorfor amalformed
agents.<name>entry (missingtype, non-mapping value) before anycredential/provider check runs.
Supporting information
implemented at all in this same code path) — this issue is about the silent-default
failure mode, independent of whether reference resolution ever gets implemented.
src/cleveractors/agents/factory.pylines 176-300 (create_agent/_create_agent_instance),line 503 (
validate_configuration, currently dead code from this path's perspective).src/cleveractors/core/application.pyline 266 (the only existing caller ofvalidate_configuration()).src/cleveractors/runtime.pylines 77-131 (Executor.__init__— no validation call).src/cleveractors/agents/llm.pyline 306 (LLMAgentprovider default).Subtasks
AgentFactory.validate_configuration()(or extract/reuse its logic) fromExecutor.__init__, after theAgentFactoryis constructed and before any agent iscreated.
validate_configuration()'s error messages to be clear at this callsite (e.g. include the actor/graph name if available).
type, non-mapping agent entry, and atypo'd-key case.
nox -s coverage_report.nox(all default sessions), fix any errors.Definition of Done
This issue is complete when:
Commit Message in Metadata exactly, followed by a blank line, then additional lines
providing relevant details about the implementation.
exactly.
master, reviewed, and mergedbefore this issue is marked done.