Nested background agents recursively spawn sub-agents, loop on filler no-ops for 6.5+ hours, and become unreachable/unstoppable once the spawning agent's session ends
Open 💬 9 comments Opened Jul 3, 2026 by bob-vistasecurity
Summary
A background research agent (spawned via the Agent tool with run_in_background) recursively spawned its own further background sub-agents rather than doing the work inline. At least one of those sub-agents got stuck in a loop of filler/no-op tool calls instead of quiescing while waiting for its children's completion notifications, and has now been "running" for 6.5+ hours. Once the spawning sub-agent's own session ended, its children became unreachable from the top-level conversation — TaskStop/TaskOutput return No task found with ID for them — yet they remain visibly "running" in the task panel with no way to stop them.
Steps to reproduce
- From a top-level session, use the
Agenttool to spawn a background research agent whose prompt covers several independent sub-topics (in our case, a multi-part codebase research request). - That agent's transcript shows it spawning its own set of further background research agents ("Ran 4 agents") rather than answering the sub-topics inline via its own tool calls.
- One of those second-level agents then enters a repeating loop of tool calls that do nothing productive while waiting for its own children: "Checked current time," "idled," a widget-context read, a
Monitorcall that times out, repeated explicit "No-op while waiting for background agents," etc. — instead of just returning control and waiting for the async completion notification. - This loop has continued for 6.5+ hours per the task panel, across (at least) 4 sibling tasks from the same fan-out.
- From the top-level conversation, calling
TaskStop/TaskOutputon the agent ID visible in that transcript returnsNo task found with ID: <id>— the top-level session has no handle on a task spawned by an intermediate agent, especially after that intermediate agent's own session has ended.
Expected behavior
- An agent waiting on its own spawned sub-agents should idle/quiesce and wait for the completion notification, not repeatedly re-invoke itself to perform filler tool calls.
- Tasks should not become permanently orphaned and unstoppable just because the agent that spawned them is no longer active — the top-level session (or some management surface) should retain the ability to inspect/stop all descendant tasks in the tree, or descendants should be cleaned up when their parent's session ends.
- (Related, likely a prompting/guardrail issue rather than a hard bug: agents instructed to research a topic inline are instead recursively spawning further background agents, compounding the above.)
Environment
- Claude Code desktop app for Windows, version 1.18286.0 (259c3f), built 2026-07-02T07:11:03.000Z
- Windows 11, version 25H2, build 26200.8655
- Observed via the
Agenttool withrun_in_background: truetriggering nestedAgentcalls from within a spawned agent
This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗