hermes - 💡(How to fix) Fix delegate_task hangs with 0 API calls when web + secondary toolset + long context + max_iterations >= ~20 [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#14726Fetched 2026-04-24 06:14:58
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Timeline (top)
labeled ×4commented ×2cross-referenced ×1

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.

Error Message

  • Detect and surface initialization failures (model call rejection, prompt too large, transport error)

Root Cause

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.

Fix Action

Workaround

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

Code Example

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"]
)

---

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
RAW_BUFFERClick to expand / collapse

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

ContextToolsetsmax_iterResultDurationAPI Calls
minimal[]3PASS6s1
short["web"]10PASS96s3
short["terminal"]10PASS17s2
short["web","terminal","file"] batch5 eachPASS14s
long["web"]30PASS67s3
long["terminal"]30PASS272s30
long["web"]5PASS150s5
long["web","file"]30FAIL300s0
long["web","terminal"]5PASS150s5
long["web","terminal"]30FAIL300s0
med-short["web","terminal"]30PASS250s18
medium["web","terminal"]30FAIL300s0

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

extent analysis

TL;DR

The most likely fix for the delegate_task hanging issue is to cap max_iterations at 5-10 when combining web with other toolsets or use single-toolset sub-agents for deep research tasks.

Guidance

  • Verify that the issue is indeed caused by the combination of web toolset, long context, and high max_iterations by testing with different configurations.
  • Consider implementing a workaround by capping max_iterations at 5-10 when combining web with other toolsets.
  • To better diagnose the issue, add sub-agent process logging to a dedicated log file (~/.hermes/logs/subagent-{timestamp}.log) to capture any initialization failures or errors.
  • Test the delegate_task function with a debug: true parameter to stream sub-agent stdout/stderr back to the parent and gather more information about the issue.

Example

No code snippet is provided as the issue is more related to configuration and logging.

Notes

The provided hypotheses suggest that the issue might be related to prompt construction deadlock, context window overflow, or transport deadlock. However, without more information or logs, it's difficult to pinpoint the exact cause.

Recommendation

Apply the workaround by capping max_iterations at 5-10 when combining web with other toolsets, as this has been shown to resolve the issue in some cases. Additionally, consider implementing the suggested fix of adding sub-agent process logging and detecting initialization failures to better diagnose and resolve the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING