agency_agents_delegate previously nested delegate_task through ctx.dispatch_tool(), which returns error JSON as a string instead of raising — so the router reported delegated: true with {"error": "delegate_task requires a parent agent context."} and never delegated (#802, #838). It now launches the specialist through ctx.subagent_lifecycle (upstream hermes-agent PR #72501): bounded wait, cooperative cancel on timeout, honest delegated: false + fallback prompt on launch/terminal failure, 32,000-char context cap, toolsets option removed. Kept in scripts/build-hermes-plugin.py so regeneration preserves it; six behavior tests in scripts/test-hermes-plugin.py.
Verified live in an isolated Hermes git-main (v0.21.0) box on local Qwen: main plugin -> delegated: true with the error string in 0.01 s; this plugin -> real child session, real result.
Fixes#802. Fixes#838.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Two correctness fixes to the Hermes plugin generator:
1. slug alias (#665): agency_agents_search returns results keyed by `slug`,
but load/inspect/delegate only accepted a param named `agent`, so the
natural chain search -> load(slug=...) failed with "agent not found".
Add `slug` as an optional alias across the READ/PROMPT/DELEGATE schemas
and resolve either key in the handlers (via _identifier), with a clear
"agent or slug is required" error when neither is passed. Backward
compatible; `required` relaxed to [] (task-only for delegate).
2. division drift: AGENT_DIRS was a hardcoded copy of the division list that
the bash check-divisions.sh guard can't see (it's a Python list), so it
silently dropped healthcare (#655) — the two healthcare agents were
missing from the Hermes roster. Derive the division dirs from
divisions.json instead (mirrors the #659 fix to check-agent-originality.sh),
so the roster stays in sync with the catalog by construction.
Verified on the regenerated plugin: roster is 235 agents (healthcare now
indexed); search "clinical evidence healthcare" -> inspect(slug=...) resolves
to Clinical Evidence Agent — exercising both fixes together. agent= still works.
Fixes#665
Claude-Session: https://claude.ai/code/session_01WKnDRWM4izsB8WAXKszhsq
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>