Skip to content

delegate_task hangs with 0 API calls when web + secondary toolset + long context + max_iterations >= ~20 #14726

@steezkelly

Description

@steezkelly

Bug Report: delegate_task hangs with 0 API calls when web + secondary toolset + long context + max_iterations >= ~20

Environment

  • Hermes version: v0.10.0 (installed via install.sh on 2026-04-22)
  • OS: Linux Mint 22.3 (Ubuntu 24.04 base)
  • Hardware: AMD Ryzen 5 9600X, 32GB RAM
  • Main model: moonshotai/kimi-k2.6 via Nous Portal
  • Tested delegation models: google/gemini-2.5-flash, minimax/minimax-m2.7, moonshotai/kimi-k2.6 (all reproduce)

Summary

delegate_task (and batch-mode delegate_task with tasks array) times out at 300s with zero API calls when:

  1. toolsets includes "web" AND at least one other toolset (e.g., "terminal", "file")
  2. context is "long" (detailed multi-sentence prompt)
  3. max_iterations is approximately 20 or higher

Changing any one of these three variables causes the sub-agent to work normally.

Reproduction Matrix

Context Toolsets max_iter Result Duration API Calls
minimal [] 3 PASS 6s 1
short ["web"] 10 PASS 96s 3
short ["terminal"] 10 PASS 17s 2
short ["web","terminal","file"] batch 5 each PASS 14s
long ["web"] 30 PASS 67s 3
long ["terminal"] 30 PASS 272s 30
long ["web"] 5 PASS 150s 5
long ["web","file"] 30 FAIL 300s 0
long ["web","terminal"] 5 PASS 150s 5
long ["web","terminal"] 30 FAIL 300s 0
med-short ["web","terminal"] 30 PASS 250s 18
medium ["web","terminal"] 30 FAIL 300s 0

Trigger condition: web + any_secondary_toolset + long_context + max_iterations >= ~20

Exact Failing Call

delegate_task(
    context="""Steve Kelly is a 31-year-old Navy veteran from Naples, Maine. He wants to build a personal knowledge graph using Obsidian and Honcho AI memory. You need to research Honcho's architecture deeply. Look at: 1) How the Deriver agent works for memory formation, 2) How the Dialectic API injects personal context, 3) The Peer paradigm where both users and agents are peers, 4) How representations are stored and retrieved, 5) The formal logic framework (explicit, deductive, inductive, abductive reasoning). Also check if Honcho can be self-hosted vs managed service. Report with concrete setup steps for a Linux Mint machine with Intel Arc B580 GPU, 32GB RAM.""",
    goal="Research Honcho AI memory system architecture and report findings with setup instructions for Steve's machine.",
    max_iterations=30,
    toolsets=["web", "terminal"]
)

Exact Working Call (same goal, lower max_iterations)

delegate_task(
    context="""Steve Kelly wants to research Honcho AI memory. Look at: 1) Deriver agent, 2) Dialectic API, 3) Peer paradigm, 4) Representations, 5) Formal logic framework.""",
    goal="Research Honcho AI architecture and report findings.",
    max_iterations=30,
    toolsets=["web", "terminal"]
)
# Result: PASS, 250s, 18 API calls

What Works Instead

  • Single-toolset sub-agents: ["web"] or ["terminal"] alone with long context + max_iter=30 works fine
  • Lower max_iterations: web + terminal + long context + max_iter=5 works fine
  • Shorter context: web + terminal + short context + max_iter=30 works fine
  • Terminal-spawned hermes: tmux new-session -d -s agent 'hermes chat -q "..."' works as an alternative

Hypotheses

  1. Prompt construction deadlock: The sub-agent's system prompt (tool schemas + user context) may hit an internal size limit or cause the provider (Nous inference API) to stall when web schemas + other schemas + long user prompt are combined.
  2. Context window overflow in init: High max_iterations may cause pre-allocation or validation that multiplies prompt size, pushing it over a boundary.
  3. Transport deadlock: ACP stdio transport may deadlock when the initial message exceeds a buffer size.

Logs Checked

  • ~/.hermes/logs/gateway.log — gateway not running in CLI mode
  • ~/.hermes/logs/errors.log — no sub-agent or delegation errors
  • ~/.hermes/logs/agent.log — no sub-agent entries

Sub-agent processes appear to be fully isolated; their failures do not surface in parent logs.

Workaround

Use single-toolset sub-agents for deep research tasks, or cap max_iterations at 5-10 when combining web with other toolsets.

Suggested Fix

  • Add sub-agent process logging to a dedicated log file (~/.hermes/logs/subagent-{timestamp}.log)
  • Detect and surface initialization failures (model call rejection, prompt too large, transport error)
  • Consider chunking or compressing tool schemas for sub-agents to reduce initial prompt size
  • Add a delegate_task parameter like debug: true that streams sub-agent stdout/stderr back to the parent

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High — major feature broken, no workaroundcomp/agentCore agent loop, run_agent.py, prompt buildertool/delegateSubagent delegationtype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions