-
Notifications
You must be signed in to change notification settings - Fork 0
feat: structured ModelRequirement in template agent configs #722
Description
Problem
Templates use bare tier strings for model assignment ("medium", "large", "small"). The ModelRequirement system already supports tier + priority + min_context + capabilities with personality-based affinity defaults -- but templates can't express this directly.
This means all agents of the same tier get identical matching behavior regardless of role. A CEO and a Scrum Master both on "large" are treated identically, even though the CEO benefits from quality priority and large context while the Scrum Master needs speed.
Proposed Changes
Schema extension
Extend TemplateAgentConfig.model to accept either a string (backward-compat) or a dict:
# Legacy (still works)
model: "medium"
# New structured format
model:
tier: "medium"
priority: "quality"
min_context: 100000Loader changes
_normalize_template_data()inloader.py: pass through dict model valuesTemplateAgentConfig.modelfield: change fromNotBlankStrtoNotBlankStr | dict[str, Any]- Add validator to accept both forms
Renderer changes
_expand_single_agent(): callparse_model_requirement()for structured dicts- Thread the parsed
ModelRequirementto the matching engine
Template YAML updates
Update builtin templates to use structured format where it adds value:
- Leaders/architects:
priority: quality,min_context: 100000 - SRE/DevOps:
priority: speed - Junior/mid developers:
priority: cost - Content writers:
priority: quality(creative work benefits from quality) - Scrum masters/PMs:
priority: speed(fast coordination)
Scope
Schema, loader, renderer changes + YAML updates. Tests for both string and dict model formats.