Agents are not managing subagents reliably
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What issue are you seeing?
The main agent does not handle subagents reliably.
When a subagent task takes a little longer, the main agent often stops or closes the subagent prematurely and continues the task on its own, instead of waiting for the subagent to finish.
When explicitly instructed to wait for the subagent's response and only close it when appropriate, for example, when the task is completed or an error occurs, the opposite problem happens: the main agent starts polling the subagent repeatedly at very short intervals.
While waiting, it also tends to perform unnecessary actions instead of remaining idle. It seems unable to simply wait for the subagent when no other work is required.
What steps can reproduce the bug?
- Start a new thread;
- Ask main agent to spawn a subagent to proceed with some task.
What is the expected behavior?
The main agent should manage subagents according to their actual state:
If a subagent is still working, the main agent should not terminate or close it prematurely.
If there is nothing useful to do while waiting, the main agent should become idle instead of repeatedly polling or performing unnecessary work.
The main agent should resume execution when it receives a completion/error signal from the subagent, ideally through an event, hook, or similar mechanism.
A subagent should only be closed when its work is complete, it has failed, or cancellation is explicitly required.
Ideally, waiting for a subagent should be event-driven rather than implemented through aggressive polling.
Additional information
I would say that in general, subagents are not being managed reliably, not only in these previous points.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the behavior by starting a new thread and asking the main agent to spawn a subagent, then trace how the main agent handles the subagent's state and completion or error signals. Done means the main agent waits without premature closure, aggressive polling, or unnecessary work, and resumes when the subagent finishes or fails.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- ai-infra-agents
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100