Skip to main content

hermes-delegate-routing

A fork-free Hermes Agent plugin that adds explicit per-task model / provider routing to delegate_task.

Route each subagent in a batch delegation to a different model/provider:

delegate_task(tasks=[
  {"goal": "Summarize these logs",      "model": "gemini-flash-2.0", "provider": "openrouter"},
  {"goal": "Review this diff for bugs", "model": "sonnet",           "provider": "anthropic"},
  {"goal": "Research the CVE",          "model": "deepseek-pro",     "provider": "deepseek"}
])

Per-task delegate routing was proposed upstream and not accepted; this plugin delivers it as a standalone package, so there is no fork to maintain. Full design and rationale: docs/DESIGN.md.

Install

Install into the same environment as your hermes-agent, then enable it.

pip install hermes-delegate-routing
# or, for development from a checkout:
pip install -e /path/to/hermes-delegate-routing

The pip entry point (hermes_agent.plugins) makes hermes-agent auto-discover the plugin; you still have to enable it in config.yaml:

plugins:
  enabled: [delegate_routing]

# optional:
delegate_routing:
  on_error: fail   # "fail" (default) → a bad model/provider fails the call;
                   # "fallback"       → skip the override, use batch creds, log a warning

No allow_tool_override grant is needed — the plugin does not use the registry override API (see "How it works").

Usage

Put routing fields inside tasks[]even for a single task:

delegate_task(tasks=[{"goal": "…", "model": "sonnet", "provider": "anthropic"}])
  • model — a model name/alias as used by /model (e.g. sonnet, gemini-flash-2.0), optionally with inline --provider <id>.
  • provider — a configured provider id. Prefer this structured field over embedding --provider in model.
  • Precedence: per-task tasks[i]delegation.* config → parent agent.
  • A task with no model/provider inherits the normal delegation model.

Top-level delegate_task(model=…, provider=…) is intentionally not supported — the host drops top-level args before the tool runs, so only tasks[] fields take effect. This matches the recommended call shape (see docs/DESIGN.md).

How it works

delegate_task is special-cased in the host runtime (agent/agent_runtime_helpers.py) to bypass the tool registry, so the sanctioned register_tool(override=True) mechanism can't intercept it. Instead the plugin installs three narrow, idempotent monkeypatches on tools.delegate_tool at load:

  1. schema — advertise tasks[].model / tasks[].provider to the model (via the registered ToolEntry);
  2. capture — wrap delegate_task to resolve per-task creds (reusing the host /model switch pipeline) and stash them by task index;
  3. apply — wrap _build_child_agent to inject those creds per child.

If the host isn't importable or its function signatures don't match, apply_patches() refuses to patch and the plugin degrades to a no-op — core behavior is never left half-patched. See docs/DESIGN.md.

Supported versions

Verified against upstream NousResearch/hermes-agent:

hermes-agent Status
0.21.0 (tag v2026.8.31) ✅ verified — seams, resolver, Tier-1 end-to-end routing, and deadlock-free plugin-loader path exercised against the host
0.19.0 (tag v2026.7.20) ✅ verified — seams, resolver, Tier-1 end-to-end routing, and the real host plugin-loader path all exercised against the host
0.18.0 ✅ verified (earlier release)

Because the plugin depends on host internals, new hermes-agent releases can drift. The signature guard turns drift into a safe no-op with a loud log, not a crash. File an issue if you hit an INACTIVE warning on a newer version.

Development

uv run --extra dev pytest            # unit tests (no host needed; uses fakes)
uv run --extra dev ruff check .      # lint
uv run --extra dev mypy              # type-check

# host-backed tests (integration smoke + Tier-1 e2e) against a real host —
# they self-skip when no host is importable:
PYTHONPATH=/path/to/hermes-agent:. \
  /path/to/hermes-agent/.venv/bin/python -m pytest tests/test_integration_smoke.py tests/test_e2e_routing.py

The host-backed tests also run in CI as an opt-in e2e job — see docs/CI_E2E_TESTING.md.

License

MIT

Release files for hermes-delegate-routing 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hermes-delegate-routing 0.1.3
File Size Uploaded
hermes_delegate_routing-0.1.3.tar.gz 23.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hermes-delegate-routing 0.1.3
File Interpreter ABI Platform
hermes_delegate_routing-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 37.2 kB

Release files / hermes_delegate_routing-0.1.3.tar.gz

Download URL hermes_delegate_routing-0.1.3.tar.gz
Size 23.1 kB
Tags Source
SHA-256 checksum
How to use checksums
36616c41c73534a8401818478495109696c6b2627a5361c1fdb5bf14a274ed67
BLAKE2b-256 checksum
How to use checksums
da9c37b4fa0d780082fc1c2078df2578180242b939864f8944ca9c74c835fa59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release files / hermes_delegate_routing-0.1.3-py3-none-any.whl

Download URL hermes_delegate_routing-0.1.3-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8479f9ade990ed0c1c00f9478e69aa20735e4a89190990bab34c4dd61c7d20ff
BLAKE2b-256 checksum
How to use checksums
4fcb10635c36b0ead37ae23e1c049d389121c578dff973b60ca6a817a50a05c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page