Skip to content

The agent that grows with you

docs(delegation): document delegation.backend, delegation.backends and route fields

Teknium1266b3a86fff
diff --git a/cli-config.yaml.example b/cli-config.yaml.example
index f2a0eb6b1d6..4e483a0cf72 100644
--- a/cli-config.yaml.example
+++ b/cli-config.yaml.example
@@ -1843,6 +1843,27 @@ code_execution:
# The delegate_task tool spawns child agents with isolated context.
# Supports single tasks and batch mode (default 3 parallel, configurable).
delegation:
+ # backend: "default" # Strategy routing each delegate_task task: "default" = the keys below,
+ # else the parent's route. A plugin backend (model_map, profile_routes)
+ # that is missing or disabled falls back to "default" with one warning.
+ # backends: # Each plugin backend's own settings, keyed by its backend name.
+ # model_map: # delegation-model-map plugin (backend: model_map)
+ # options:
+ # - name: fast
+ # description: "Cheap and quick; lookups, summaries, simple edits."
+ # provider: "openrouter"
+ # model: "google/gemini-3-flash-preview"
+ # - name: deep
+ # description: "Slow and careful; hard debugging and design work."
+ # provider: "anthropic"
+ # model: "claude-opus-5"
+ # reasoning_effort: "high"
+ # service_tier: "fast" # optional: refused at spawn when the route has no such tier
+ # default: fast # optional: option for tasks that set none
+ # profile_routes: # delegation-profiles plugin (backend: profile_routes). A listed
+ # profiles: # profile's subagents use ITS credentials, pool, SOUL.md and terminal policy.
+ # - name: coder
+ # description: "Writes and refactors code; runs tests."
max_iterations: 250 # Max tool-calling turns per child (default: 250)
# max_concurrent_children: 10 # Max parallel child agents per batch (default: 10, floor: 1, no ceiling).
# WARNING: values above 10 multiply API cost linearly.
diff --git a/tools/AGENTS.md b/tools/AGENTS.md
index b7cb06449ae..8739280e3ba 100644
--- a/tools/AGENTS.md
+++ b/tools/AGENTS.md
@@ -137,11 +137,12 @@ no `delegate_task`, `clarify`, `memory`, `send_message`, `cronjob`; keeps `execu
`orchestrator` (keeps `delegate_task`; gated by `delegation.orchestrator_enabled`, bounded by
`delegation.max_spawn_depth`, default 2). Config knobs under `delegation:`:
`max_concurrent_children, independent_completions, max_spawn_depth, child_timeout_seconds, orchestrator_enabled,
-subagent_auto_approve, inherit_mcp_toolsets, max_iterations, backend`. **Routes:** `delegation.backend` picks a
-delegation provider (`agent/delegation_provider.py`, `ctx.register_delegation_provider`) that answers each task's route
-(`tools/delegate_tool_routes.py`: model/provider fields resolved like the `delegation` section, or `profile` → the child
-is built, leases and converses inside that profile's scope) and may add enum-checked per-task schema params; it never owns
-lifecycle. Internal `credentials_cfg` callers (/review) and the lifecycle API bypass it. **Child processes:** a child's background
+subagent_auto_approve, inherit_mcp_toolsets, max_iterations, backend, backends`. **Routes:** `delegation.backend` picks a
+delegation provider (`agent/delegation_provider.py`, `ctx.register_delegation_provider`; its settings live in
+`delegation.backends.<name>`) that answers each task's route (`tools/delegate_tool_routes.py`: model/provider fields
+resolved like the `delegation` section, `service_tier` checked like `/fast` in `delegate_tool_tuning.py`, or `profile` →
+the child is built, leases and converses inside that profile's scope) and may add enum-checked per-task schema params; it
+never owns lifecycle. Internal `credentials_cfg` callers (/review) and the lifecycle API bypass it. **Child processes:** a child's background
processes are killed at its teardown and their notices are suppressed in the parent; `process_manage(action="handoff")`
(children only) flips `ProcessSession.owner_task_id` to the parent under the registry lock
(`process_registry.transfer_ownership`) so the completion routes and reaps by the new owner; un-handed leftovers land on
diff --git a/website/docs/developer-guide/delegation-provider-plugin.md b/website/docs/developer-guide/delegation-provider-plugin.md
index 8757faceb36..0ac084f6908 100644
--- a/website/docs/developer-guide/delegation-provider-plugin.md
+++ b/website/docs/developer-guide/delegation-provider-plugin.md
@@ -14,8 +14,8 @@ Hermes core keeps the whole subagent lifecycle: spawning, isolation, leaf/orches
limits, concurrency, background completion units, stop fan-out, result assembly, `output_schema`
validation and progress. A provider only answers "which route does this task take".
-The active provider is `delegation.backend` in `config.yaml`. The built-in `default` strategy is
-today's behaviour: every child follows the `delegation` section (`delegation.provider`,
+The active provider is `delegation.backend` in `config.yaml`; a provider's own settings live under
+`delegation.backends.<backend name>`. The built-in `default` strategy is today's behaviour: every child follows the `delegation` section (`delegation.provider`,
`delegation.model`, `delegation.base_url`, ...), or inherits the parent's route when those are empty.
A configured backend that is not installed or reports unavailable falls back to `default` with one
warning, and its schema parameters disappear with it.
@@ -33,7 +33,7 @@ class Tiers(DelegationProvider):
return "tiers" # delegation.backend: tiers
def task_parameters(self, config):
- tiers = config.get("tiers") or [] # your own delegation.<key> settings
+ tiers = self.settings(config).get("tiers") or [] # delegation.backends.tiers.tiers
return {"tier": {
"type": "string",
"enum": [t["name"] for t in tiers],
@@ -44,7 +44,7 @@ class Tiers(DelegationProvider):
return "Set `tier` per task to pick the model that fits it."
def route_task(self, task, config):
- for t in config.get("tiers") or []:
+ for t in self.settings(config).get("tiers") or []:
if t["name"] == task.get("tier"):
return {"provider": t["provider"], "model": t["model"], "label": t["name"]}
if task.get("tier"):
@@ -63,16 +63,27 @@ version: 1.0.0
description: Pick a model tier per subagent.
```
+```yaml
+# config.yaml
+delegation:
+ backend: tiers
+ backends:
+ tiers: # == the backend name
+ tiers:
+ - {name: quick, description: Lookups and summaries., provider: openrouter, model: google/gemini-3-flash-preview}
+```
+
```bash
hermes plugins enable delegation-tiers
-hermes config set delegation.backend tiers
```
## The interface
`DelegationProvider` (`agent/delegation_provider.py`) subclasses the shared `ProviderBase`. Every
-method receives `config`, the `delegation` section of the active profile's `config.yaml`, so provider
-settings live next to the other delegation knobs.
+method receives `config`, the `delegation` section of the active profile's `config.yaml`: `dict(config)`
+is the default route, and `self.settings(config)` is your backend's own block,
+`delegation.backends.<name>` (empty when unset). Keep your settings there, never beside the core
+`delegation` keys.
| Member | Required | Contract |
|---|---|---|
@@ -81,6 +92,7 @@ settings live next to the other delegation knobs.
| `task_parameters(config)` | no | `{name: json_schema}` merged into `tasks.items.properties`. Core enforces `enum` before `route_task` runs and refuses core-owned names (`goal`, `context`, `index`, `output_schema`, `images`, `group`, `role`, `toolsets`, `provider`, `model`, `base_url`, `api_key`, `api_mode`, `acp_command`, `acp_args`). |
| `description(config)` | no | Guidance appended to the `delegate_task` description. |
| `is_available()` | no | No network calls. `False` makes delegation use `default`. |
+| `settings(config)` | inherited | `delegation.backends.<name>` as a mapping (empty when unset). Do not override. |
### Routes
@@ -89,6 +101,13 @@ A route is a dict with any of:
- `model`, `provider`, `base_url`, `api_key`, `api_mode`, `request_overrides`, `reasoning_effort`,
`fallback_providers`: shaped exactly like the `delegation` section and resolved by the same
credential resolver. An empty route inherits the parent's route; `dict(config)` is the default route.
+ A `reasoning_effort` that is not a known level (`none`, `minimal`, `low`, `medium`, `high`,
+ `xhigh`, ...) refuses the task with a tool error instead of falling back to the parent's level; the
+ `delegation.reasoning_effort` value itself keeps its usual warn-and-inherit rule.
+- `service_tier`: `normal`, `fast` or `ultrafast`. Core checks it against the resolved route with the
+ same gates as `/fast` (and, for `ultrafast`, the signed-in Codex account's catalog). A tier the
+ route does not offer refuses the task; otherwise it applies to that child only and is re-applied
+ after the child is built, so a custom provider's `extra_body` cannot restore another tier.
- `profile`: the name of a Hermes profile. The child runs **as that profile**: its `config.yaml`,
primary model and credentials (a `model.default` alias or named provider resolves exactly as at
CLI startup), credential pool, fallback chain, reasoning (`agent.reasoning_effort` and
@@ -99,9 +118,20 @@ A route is a dict with any of:
the launching profile's environment. The child's transcript stays in the launching profile's
session database (it is the parent's work) and it keeps the parent's toolset. Other route keys are
ignored on a profile route.
-- `label`: short text reported as `route` on the child's result (an option title, a profile name).
+- `label`: short text identifying the route (an option title, a profile name).
+
+Unknown keys are dropped. On a profile route, `service_tier` and `reasoning_effort` are ignored too.
+
+Every result entry of a task your backend routed carries `route`: the `label` plus what the child
+actually ran on, read off the built child:
+
+```json
+"route": {"label": "deep", "provider": "openai-codex", "model": "gpt-6-astra",
+ "reasoning_effort": "high", "service_tier": "fast"}
+```
-Unknown keys are dropped.
+`reasoning_effort` is `null` when the provider's default applies. Results of the built-in `default`
+strategy carry no `route`, so their shape is unchanged.
## Prompt caching
@@ -119,7 +149,7 @@ runs in the plugin host process.
## Testing
Load the plugin through the real discovery path against a temporary `HERMES_HOME` whose
-`config.yaml` sets `plugins.enabled` and `delegation.backend`, then assert on behaviour: the
+`config.yaml` sets `plugins.enabled`, `delegation.backend` and `delegation.backends.<name>`, then assert on behaviour: the
`delegate_task` definition from `tools.registry.registry.get_definitions({"delegate_task"})` carries
your parameter, and `tools.delegate_tool.delegate_task(...)` hands each child the route you chose.
`tests/tools/test_delegation_backends.py` in the Hermes repo is a complete example.
diff --git a/website/docs/user-guide/configuration.md b/website/docs/user-guide/configuration.md
index 84facf4b33b..95af7a65e69 100644
--- a/website/docs/user-guide/configuration.md
+++ b/website/docs/user-guide/configuration.md
@@ -2994,6 +2994,10 @@ Configure subagent behavior for the delegate tool:
```yaml
delegation:
+ backend: default # Delegation strategy routing each task: "default" = the keys below, or a plugin backend (model_map, profile_routes, ...)
+ # backends: # Each plugin backend's own settings, keyed by its backend name
+ # model_map:
+ # options: [...]
# model: "google/gemini-3-flash-preview" # Override model (empty = inherit parent)
# provider: "openrouter" # Override provider (empty = inherit parent)
# base_url: "http://localhost:1234/v1" # Direct OpenAI-compatible endpoint (takes precedence over provider)
@@ -3011,6 +3015,8 @@ delegation:
oneshot_max_children: 2 # Total subagents a one-shot run (hermes chat -q / --oneshot) may spawn; 0 = unlimited. Interactive and gateway sessions are never capped by this.
```
+**Delegation strategy (`backend`):** `delegation.backend` picks the strategy plugin that decides each subagent's route. `default` follows the keys below (or the parent's route when they are empty). Plugin strategies such as `model_map` (a named model per task) and `profile_routes` (a Hermes profile per task) read their settings from `delegation.backends.<backend name>`. A backend whose plugin is missing or disabled falls back to `default` with one warning. See [Subagent Delegation → Delegation strategies](features/delegation.md#delegation-strategies-delegationbackend).
+
**Subagent provider:model override:** By default, subagents inherit the parent agent's provider and model. Set `delegation.provider` and `delegation.model` to route subagents to a different provider:model pair — e.g., use a cheap/fast model for narrowly-scoped subtasks while your primary agent runs an expensive reasoning model.
**Subagent fallback chain:** Set `delegation.fallback_providers` to give workers their own chain (same entry shape as the top-level list). An explicitly pinned child (by provider, endpoint, or model) uses that chain only when it is declared; otherwise it fails loudly instead of borrowing the parent agent's route. For an unpinned child, an absent or `null` setting preserves parent-chain inheritance. Use `fallback_providers: []` under `delegation:` to disable child fallback entirely.
diff --git a/website/docs/user-guide/features/delegation.md b/website/docs/user-guide/features/delegation.md
index 3b734a88f71..7af07ebcc94 100644
--- a/website/docs/user-guide/features/delegation.md
+++ b/website/docs/user-guide/features/delegation.md
@@ -297,15 +297,39 @@ Note that the pin is global: with the default strategy `delegate_task` has no pe
`delegation.backend` selects how each task becomes a subagent. `default` (the default) is everything above. Strategy plugins can let the model choose per task, from options you define:
-- a **profile per subagent**: each child runs as one of your Hermes profiles, with that profile's model, credentials, skills and persona;
-- a **named model map**: you list titled options (`fast`, `deep`, ...) with a description and a provider/model each, and the model picks one per task.
+- a **profile per subagent** (`profile_routes`, from the `delegation-profiles` plugin): each child runs as one of your Hermes profiles, with that profile's model, credentials, skills and persona;
+- a **named model map** (`model_map`, from the `delegation-model-map` plugin): you list titled options (`fast`, `deep`, ...) with a description and a provider/model each, and the model picks one per task.
+
+Each strategy's settings live under `delegation.backends.<backend name>`:
```yaml
delegation:
- backend: model-map # the plugin's backend name
+ backend: model_map
+ backends:
+ model_map:
+ options:
+ - name: fast
+ description: Cheap and quick; lookups, summaries, simple edits.
+ provider: openrouter
+ model: google/gemini-3-flash-preview
+ - name: deep
+ description: Slow and careful; hard debugging and design work.
+ provider: anthropic
+ model: claude-opus-5
+ reasoning_effort: high
+ service_tier: fast # optional; refused at spawn if this route has no fast tier
+ default: fast # optional: option for tasks that set none
+ profile_routes: # read when backend: profile_routes
+ profiles:
+ - name: coder
+ description: Writes and refactors code; runs tests.
```
-The model only ever sees the names and descriptions you configured, never raw provider, model or key fields. If the selected plugin is missing or disabled, delegation falls back to `default`. Writing your own: [Delegation Provider Plugins](../../developer-guide/delegation-provider-plugin.md).
+The model only ever sees the names and descriptions you configured, never raw provider, model or key fields. A route's `service_tier` is checked like `/fast`: a tier the route does not offer, or an unknown `reasoning_effort`, fails the spawn with a tool error instead of silently running at another level. Each result of a routed task carries `route` (the option or profile name plus the provider, model, reasoning effort and speed tier the child actually ran on). If the selected plugin is missing or disabled, delegation falls back to `default`. Writing your own: [Delegation Provider Plugins](../../developer-guide/delegation-provider-plugin.md).
+
+:::note Profile routes share credentials
+Listing a profile in `delegation.backends.profile_routes` lets this profile's subagents use that profile's credentials, credential pool, `SOUL.md` and terminal policy. Only list profiles whose keys and terminal access you are happy for this profile's agent to use.
+:::
## The `/review` Command