feat(tools): add delegation model pool with per-call model/provider override#5229
feat(tools): add delegation model pool with per-call model/provider override#5229HenkDz wants to merge 1 commit into
Conversation
393f343 to
c2ffc7f
Compare
…verride Add intelligent model routing for subagent delegation via a configurable model pool and per-call overrides. - delegation.pool: users define models with strengths, injected into delegate_task schema so the LLM picks the best model per task - model param: per-call or per-task (batch mode) model override - provider param: per-call provider override with full credential resolution - Pool validation: if a model is set but not in pool, falls back with warning - Dynamic schema: _build_delegate_schema() reads pool from config at load time Resolution order (highest to lowest): 1. Per-call model param (top-level, applies to all tasks) 2. Per-task model field (batch mode only) 3. Pool validation — if model set but not in pool, falls back with warning 4. delegation.model from config (fallback default) 5. Parent agent's model (inherited) Supersedes NousResearch#3794 (clean rebase on latest main).
c2ffc7f to
e38deec
Compare
|
Pool + per-call override layering looks clean, and the 5-level resolution hierarchy is explicit. One question: does the dynamic schema builder regenerate the |
cached, The only way it would rebuild is if you changed your config and restarted hermes, which is expected behavior anyway. |
… reasoning_effort Unified implementation combining tier profiles (from stale PR NousResearch#5692) with model pool validation (inspired by PR NousResearch#5229). Features: - 5 named tiers: light, heavy, review, planning, research - Each tier configures model, provider, reasoning_effort, max_iterations - Reasoning floor guardrails prevent silent degradation: heavy/research >= medium, planning/review >= high - Per-task tier in batch mode overrides top-level tier - Optional delegation pool for model validation - override_reasoning_effort in _build_child_agent - resolve_tier_config() merges tier over flat base config - Schema updated with tier enum at top-level and per-task Resolution order: task.tier > top-level tier > default_tier > flat config > parent Config example: delegation: default_tier: heavy tiers: light: {model: gpt-5.4-mini, reasoning_effort: low, max_iterations: 25} review: {model: gpt-5.4, reasoning_effort: xhigh, max_iterations: 60} pool: - model: gpt-5.4, strengths: coding, debugging Tests: - 56 new unit tests (test_delegate_tiers.py) - 7 real integration tests (test_delegate_tiers_real.py) - 128 total delegate tests passing - Backward compatibility verified (flat configs work unchanged)
… reasoning_effort Unified implementation combining tier profiles (from stale PR NousResearch#5692) with model pool validation (inspired by PR NousResearch#5229). Features: - 5 named tiers: light, heavy, review, planning, research - Each tier configures model, provider, reasoning_effort, max_iterations - Reasoning floor guardrails prevent silent degradation: heavy/research >= medium, planning/review >= high - Per-task tier in batch mode overrides top-level tier - Optional delegation pool for model validation - override_reasoning_effort in _build_child_agent - resolve_tier_config() merges tier over flat base config - Schema updated with tier enum at top-level and per-task Resolution order: task.tier > top-level tier > default_tier > flat config > parent Config example: delegation: default_tier: heavy tiers: light: {model: gpt-5.4-mini, reasoning_effort: low, max_iterations: 25} review: {model: gpt-5.4, reasoning_effort: xhigh, max_iterations: 60} pool: - model: gpt-5.4, strengths: coding, debugging Tests: - 56 new unit tests (test_delegate_tiers.py) - 7 real integration tests (test_delegate_tiers_real.py) - 128 total delegate tests passing - Backward compatibility verified (flat configs work unchanged)
Summary
Add intelligent model routing for subagent delegation via a configurable model pool and per-call overrides.
Problem: Users with access to multiple models/providers (e.g. via OpenRouter or Z.AI) had no way to control which model a subagent uses at call time.
Solution:
Delegation model pool (
delegation.pool): Users define a list of models with strengths. The pool is injected into thedelegate_tasktool description, so the LLM sees available models and picks the best fit automatically.Per-call overrides:
modelandproviderparams ondelegate_taskfor explicit routing. Per-taskmodelfield in batch mode.Pool validation: If a model is set but not in the pool, falls back to default with a warning.
Changes
tools/delegate_tool.py: Dynamic schema builder, pool validation, per-task model supporthermes_cli/config.py: Addpoolto DEFAULT_CONFIGcli-config.yaml.example: Document pool configurationwebsite/docs/user-guide/configuration.md: Add Delegation Model Pool sectionModel resolution (highest to lowest)
modelparammodelfield (batch mode)delegation.modelfrom configTest plan