feat(skills): per-skill model preference via hermes.model frontmatter - #30522
feat(skills): per-skill model preference via hermes.model frontmatter#30522alf3lobster wants to merge 1 commit into
Conversation
Adds two composable pieces so skill authors can declare which model a
skill works best with, and callers can honour that when delegating.
**metadata.hermes.model in SKILL.md frontmatter**
Parsed by extract_skill_conditions alongside the existing toolset
conditions. Surfaced in _find_all_skills output (and GET /api/skills).
Skills that omit the field default to "" — fully backward-compatible.
**model parameter on delegate_task**
A per-call override threaded through the task loop and _build_child_agent.
Precedence: per-call model > delegation.model (config) > parent_agent.model.
Works for single-task and batch modes; in batch mode each task can set
its own model independently.
Example SKILL.md frontmatter:
metadata:
hermes:
model: "anthropic/claude-opus-4-7"
Example invocation:
delegate_task(goal="Run account-research", model="anthropic/claude-opus-4-7")
Tests: test_skill_utils.py updated for new model key; two new tests for
present/absent field.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Thanks for the context, @alt-glitch. Aware of those issues — this PR is intentionally a minimal slice of what #8485 proposed, covering only mechanisms 1 and 2 (the The goal was to get the lowest-risk piece merged first: pure data (frontmatter parsing) and a single optional parameter that preserves full backward-compat. The config aliases from #8485 mechanism 3 are a separate concern. If there's a preferred approach or concerns about the schema surface (e.g. whether |
|
This would cause too much confusion to users, feel free to build a standalone plugin that makes this possible if you'd like |
What this does
Adds two composable pieces so skill authors can declare which model a skill works best with, and callers can honour that when delegating.
1.
metadata.hermes.modelin SKILL.md frontmatterParsed by
extract_skill_conditionsalongside the existing toolset conditions. Surfaced in_find_all_skillsoutput (andGET /api/skills). Skills that omit the field default to""— fully backward-compatible.2.
modelparameter ondelegate_taskA per-call override threaded through the task loop and
_build_child_agent. Works for single-task and batch modes; in batch mode each task can set its own model independently.Precedence: per-call
model>delegation.model(config) >parent_agent.modelWhat this doesn't do (intentional scope)
Automatic model injection without LLM involvement. A follow-up could add a
skillparameter that looks up the model from frontmatter automatically without the LLM needing to pass it explicitly.Files changed
agent/skill_utils.py—extract_skill_conditionsreturnsmodelkeytools/skills_tool.py—_find_all_skillssurfacesmodelin outputtools/delegate_tool.py—modelin schema (top-level + per-task) and function signature; per-task model resolution in build loop; registry handler updatedrun_agent.py—_dispatch_delegate_taskthreadsmodelthroughtests/agent/test_skill_utils.py— three updated assertions + two new tests