o3-mini / 4o-mini: codex cli agent repeatedly spawns same subagent and hits thread limit

Resolved 💬 5 comments Opened Mar 16, 2026 by devinder-augur Closed Mar 16, 2026

Models: o3-mini, 4o-mini (via Responses API)

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

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗