You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
o3-mini / 4o-mini: codex cli agent repeatedly spawns same subagent and hits thread limit #14841
Behavior: When using spawn_agent (or equivalent delegation), the agent repeatedly spawns the same subagent for the same task instead of waiting for the result. This leads to hitting the thread limit and the run failing.
Expected: After calling spawn_agent for a task, the agent should wait for that subagent’s result, then continue (e.g. close_agent and move on). It should not spawn another agent for the same work.
Question: Is there recommended prompt or configuration guidance to avoid this “spawn same agent again” behavior and stay within thread limits (e.g. one spawn per logical task, then wait for result)?
PS: I have my own custom agent and instruction and codex keep spawning same agent again and again with same instructions. Instruction is to spawn one at time
Those older models predate subagents, so they are not expected to perform well with the latest subagent support in Codex. For a list of recommended models to use with Codex, please refer to this documentation.
Those older models predate subagents, so they are not expected to perform well with the latest subagent support in Codex. For a list of recommended models to use with Codex, please refer to this documentation.
Does that mean only 5.x models are good at subagents / work fine ? I wanted to use relatively cheaper models hence chose 4o-mini / o3-mini
@etraut-openai this happens with gpt-5.2-codex as well. and i am getting Failed to delegate task: spawn_agent error 'agent thread limit reached (max 1)'.
Activity
github-actions commentedon Mar 16, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
devinder-augur commentedon Mar 16, 2026
none of threads above have valid fixes
etraut-openai commentedon Mar 16, 2026
Those older models predate subagents, so they are not expected to perform well with the latest subagent support in Codex. For a list of recommended models to use with Codex, please refer to this documentation.
devinder-augur commentedon Mar 16, 2026
Does that mean only 5.x models are good at subagents / work fine ? I wanted to use relatively cheaper models hence chose 4o-mini / o3-mini
devinder-augur commentedon Mar 16, 2026
@etraut-openai this happens with gpt-5.2-codex as well. and i am getting
Failed to delegate task: spawn_agent error 'agent thread limit reached (max 1)'.fix(core): scope inherited history for forked subagents