Add support for resolving agent-type registry package references in agents.<name> #121
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
#125 feat(agents): resolve agent- and route-type registry package references in agents.<name> and routes.<name>
cleveragents/cleveractors-core
Reference
cleveragents/cleveractors-core#121
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
feat(agents): resolve agent- and route-type registry package references in agents.<name> and routes.<name>feature/agent-package-referencesBackground and context
The Actor Configuration Standard (
docs/index.md§4.1) only defines two shapes for anagents.<name>entry: an inlinetype:/config:mapping, or atemplate:/agent_template:instantiation from a template-type component registered undertemplates.agents(§8.7). The Package Registry Standard (docs/actor-registry-standard.md§3.2) separately defines a plain
agent-type package (prefixpkg_agt_) — "Agentdefinitions that can be referenced in actor configurations" — as its own package type,
distinct from
template(prefixpkg_tpl_).There is currently no field or mechanism anywhere in
cleveractorsthat resolves a bareagent-type package reference (local:<path>orhost:namespace/name[@version], perPackage Registry Standard §5.3) into a usable agent. The only working
reference-resolution mechanism for agents is
SkillLoader/SkillReferenceResolver, andthat only resolves
skills:entries on an already-instantiatedtype: llmagent, not theagents.<name>entry itself —create_executor's own docstring (src/cleveractors/runtime.pylines ~299-314) is explicit that
local_store/registry_api_keyare scoped toskills:resolution only.
Current behavior
Using the library's documented
create_executorentry point(
docs/guides/reasoning-aware-llm-agents.md) with a bare package-reference agent entry:fails with:
Root cause:
AgentFactory.create_agent/_create_agent_instance(
src/cleveractors/agents/factory.pylines ~196-213) unconditionally treatsagents_config[agent_name]as a mapping (agent_config.get("type", "llm")), with nobranch for a bare reference string.
create_executoralready acceptslocal_storeandregistry_api_key(used today only forskills:resolution), so the plumbing needed toresolve such a reference is present in the call signature but not wired to agent creation.
The same gap exists for a
template:/agent_template:mapping whose value is such areference:
AgentFactoryhas no awareness of thetemplate/agent_templatekeys at all(that recognition exists only in
reactive/config_parser.py'sReactiveConfigparsing andcore/application.py's_create_agents, neither of whichAgentFactory/Executoruses).So
agents.<name>: {"agent_template": "local:worker-agent.yaml"}produces no error at allvia this path — it silently degrades to an empty
type: llmagent (no"type"/"config"key present), a related but distinct failure mode tracked in #122.
Scope update — the identical bug class also affects
routes.<name>During implementation, this same reference-resolution gap was confirmed to also affect the
routessection, for the exact same reason: the Package Registry Standard (§3.2) definesgraph-type (pkg_grh_) andstream-type (pkg_str_) packages as "route definitions thatcan be used as components in larger systems", but
docs/index.md§5.1'sroutesgrammarnever named a bare-reference form either, and
cleveractors.runtime_dispatch._execute_graph/_execute_graph_streamexhibit the identical code defect:main = routes.get("main", {})followed by
main.get("nodes", {})assumesmainis a mapping, soroutes.main: "local:main-graph.yaml"fails with the same rawAttributeError.Because both gaps share one root cause and one fix shape, they are addressed together in
this issue/PR rather than split into a separate issue, per maintainer direction. See
docs/adr/ADR-2037-agent-and-route-package-reference-resolution.mdfor the consolidateddecision record (D-1 through D-6 cover
agents.<name>; D-7 through D-9 coverroutes.<name>). This project's implementation resolves aroutes.<name>reference onlyfor the single
routes.mainentry_execute_graph/_execute_graph_streamread, fixed topackage_type="graph"(stream routes are not reachable viacreate_executor's dispatchtable);
docs/index.md§5.1.1 itself documents the extension generically for both packagetypes, per an implementation-agnostic Actor Configuration Standard.
Expected behavior
When
agents.<name>is a bare string (alocal:,registry:/host-qualified, orID:reference per Package Registry Standard §5.3/§7.3) rather than a mapping,
AgentFactoryshould resolve it — via the same
local_store/registry_api_keyplumbing already used bySkillLoader— to the referencedagent-type package's content, and use that content'stype/config fields to construct the agent, exactly as if that content had been inlinedunder
type:/config:.Likewise, when
routes.mainis a bare string, the graph-actor dispatch path should resolveit to the referenced
graph-type package's content and use its route fields (nodes,edges, ...) exactly as if inlined under theroutes.mainmapping form.When the reference cannot be resolved (unknown scheme, missing package, network/registry
error), agent/route creation must fail with a clear
AgentCreationError/ConfigurationErrornaming the unresolved reference — never a raw
AttributeError.Acceptance criteria
agents.<name>accepts a bare reference string (in addition to the existingtype:/config:andtemplate:/agent_template:mapping forms).local:<path>reference resolves via the suppliedLocalPackageStoreandproduces a working agent.
host:namespace/name[@version]registry reference resolves via aRegistryClientusing
registry_api_key, mirroring the resolution already implemented forskills:.AgentCreationError/ConfigurationErrorwith amessage naming the reference — not an
AttributeError.create_agent(sync) andacreate_agent(async).create_executoragainst a real/local LLM endpoint usinga config with an
agents.<name>bare-string reference.routes.mainaccepts a bare reference string (in addition to the existing mappingform), resolved to a
graph-type package.local:<path>route reference resolves via the suppliedLocalPackageStoreandproduces a working graph actor.
host:namespace/name[@version]registry route reference resolves via aRegistryClient(package_type="graph").ConfigurationErrornaming the reference —not an
AttributeError.create_executorusing a config with aroutes.mainbare-string reference.
Supporting information
docs/index.md§4.1, §4.1.1, §5.1, §5.1.1, §8.7 (Actor Configuration Standard — agentand route declaration forms)
docs/actor-registry-standard.md§3.2, §5.3, §7.3 (Package Registry Standard — packagetypes and reference formats)
docs/adr/ADR-2037-agent-and-route-package-reference-resolution.md(consolidated decisionrecord for this issue)
README.md"Quick start" /docs/guides/reasoning-aware-llm-agents.md(documentedpublic entry points:
ReactiveCleverAgentsApp,create_executor)src/cleveractors/agents/factory.py(AgentFactory.create_agent/acreate_agent)src/cleveractors/agents/agent_resolution.py(newAgentReferenceResolver)src/cleveractors/route_resolution.py(newRouteReferenceResolver)src/cleveractors/runtime_dispatch.py(_execute_graph/_execute_graph_stream—routes.mainnormalisation)src/cleveractors/runtime.py(create_executor—local_store/registry_api_keycurrently scoped toskills:only)src/cleveractors/agents/skill_resolution.py,src/cleveractors/agents/skills.py(existing working reference-resolution pattern mirrored by both new resolvers)
Subtasks
AgentFactory.create_agent/acreate_agentfor abare-string
agents.<name>value.LocalPackageStore(local:scheme).RegistryClient(host-qualified scheme), threadingregistry_api_keythe same waySkillLoaderdoes.type/configstructure_instantiateexpects.AgentCreationError/ConfigurationError(notAttributeError) on anunresolvable reference.
routes.mainvalue in_execute_graph/_execute_graph_stream.LocalPackageStore/RegistryClient(
package_type="graph").routes.mainre-fetch (parallel_executioncomputation) to reuse the normalised/resolved
mainvalue.local:and registry-reference agent AND routeresolution, and for the unresolvable-reference error path on both.
agent-type package via a graphconfiguration's
agents.<name>entry, and agraph-type package viaroutes.main.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.
Scope expanded during implementation: the same bare-string package-reference gap (raw
AttributeErrorinstead of resolving via the registry) was confirmed to also affectroutes.<name>(forgraph/stream-type packages), not justagents.<name>. Both are fixed together in this issue/PR per maintainer direction, since they share one root cause and one fix shape. See the updated issue description anddocs/adr/ADR-2037-agent-and-route-package-reference-resolution.mdfor the consolidated decision record.