Agents are not managing subagents reliably
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.
2 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
They don't look related.