#131282·hermes-agent

[Bug]: plugin SubagentLifecycleService.launch ignores the delegation pause, max_spawn_depth and the one-shot child budget

Author: jonpol01Created Oct 2, 2026Updated Oct 2, 2026
Labelstype/bugcomp/agentcomp/pluginstool/delegateP3

Pre-flight

  • Searched existing issues and PRs by SubagentLifecycleService, subagent_lifecycle, is_spawn_paused, max_spawn_depth bypass, ctx.subagent_lifecycle, "delegation spawning is paused", "plugin subagent depth limit". #106647 / #106696 (100yenadmin, open orchestration feature stacks of 77 / 89 files) each add a _validate_spawn_admission(...) call inside launch as part of a larger feature that depends on their new worker store; nothing focused on main or in review.
  • Confirmed on current main (95db0e2ada)
  • hermes debug share: N/A. Reproduced through the real delegate_task, SubagentLifecycleService.launch and _build_child_agent with the AIAgent class and the child's run body stubbed.

Bug Description

SubagentLifecycleService.launch (agent/subagent_lifecycle.py, reached by plugins through ctx.subagent_lifecycle.launch()) builds and starts a child without the admission checks delegate_task runs first (tools/delegate_tool.py):

  • the operator kill switch (is_spawn_paused(), p in /agents or the delegation.pause RPC);
  • the _delegate_depth >= delegation.max_spawn_depth refusal;
  • the one-shot delegation.oneshot_max_children budget (_oneshot_spawn_budget).

The depth bypass can recurse. _build_child_agent only downgrades an at-limit child to a leaf, and the child keeps the parent's plugin toolsets, so a child can call the plugin tool again and launch a grandchild one level deeper, and so on.

The lifecycle API doc says launch uses "the same host-owned path as delegate_task", and neither #63359 nor its salvage #72501 mentions skipping these checks, so the gap is an oversight.

Steps to Reproduce

  1. A plugin tool that calls ctx.subagent_lifecycle.launch(...).
  2. Pause delegation (p in /agents), or run with delegation.max_spawn_depth: 1 from a child already at depth 1.
  3. Call the plugin tool.

Probe output on main:

max_spawn_depth                 : 1
delegate_task at depth limit    : Delegation depth limit reached (depth=1, max_spawn_depth=1).
lifecycle.launch at depth limit : ACCEPTED (child depth 2)
delegate_task while paused      : Delegation spawning is paused. Clear the pause via the TUI (
lifecycle.launch while paused   : ACCEPTED (child depth 1)
children actually run at depths : [2, 1]

Expected Behavior

launch refuses with the same reason delegate_task gives, before any child is built.

Actual Behavior

launch accepts the request and the child runs, while paused and past the depth limit.

Affected Component

Tools (terminal, file ops, web, code execution, etc.)

Messaging Platform (if gateway-related)

N/A (CLI only)

Debug Report

N/A, reproduced in code (see Pre-flight).

Operating System

macOS 26

Python Version

3.14

Hermes Version

main 95db0e2ada

Source: NousResearch/hermes-agent