[Bug] spawn_agent hangs indefinitely without returning control

Open 💬 2 comments Opened Jul 22, 2026 by jimicze
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

Summary

A spawn_agent call remained blocked for approximately 18,901 seconds (5 hours 15 minutes) instead of returning promptly with the spawned agent ID or an actionable error.

Uploaded thread: 019f78cf-a24c-7f30-80ac-c32b3ccfc887

Steps to Reproduce

  1. Start a Codex session with existing completed or idle subagents.
  2. Call spawn_agent to create another reviewer subagent.
  3. Observe that the tool call does not return, time out, or report capacity/status information.
  4. Manually interrupt the turn.

Actual Result

The call remained pending for over five hours and finally returned:

aborted by user after 18901.0s

No agent identifier, timeout, capacity error, or recovery guidance was provided.

Expected Result

spawn_agent should:

  • Return the new agent identifier within seconds; or
  • Fail quickly with a clear capacity or scheduling error; or
  • Apply a bounded timeout and return control to the root agent.

A stalled spawn must not block the entire orchestration turn indefinitely.

Impact

  • Stops all implementation and review progress.
  • Prevents the root agent from sending user updates.
  • Requires manual interruption.
  • Creates uncertainty about whether the requested agent was partially created.
  • Wastes substantial execution time.

Environment

  • Date: 2026-07-22
  • Collaboration mode: Default
  • Repository: selectorChromePlugin
  • Existing subagents: p1_t2_implement, p1_t2_spec_review
  • Requested agent: p1_t2_quality_review

Suggested Fix

Add a bounded scheduling timeout, return explicit agent-capacity state, and make agent creation idempotent so retrying cannot create duplicate agents.

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 1 month ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #33777

Powered by Codex Action

jimicze · 1 month ago

Scope clarification after reviewing the suggested issues:

This report is not a duplicate of the planning, persistent-goal, worktree, or performance reports filed from the same uploaded thread. Its sole failure boundary is a synchronous spawn_agent call that never returned, never produced an agent ID, and monopolized the parent turn for 18,901 seconds.

I also reviewed #33777. This is an independent reproduction with a different uploaded thread, exact 5h15 duration, CLI 0.144.6, and the concrete resident-agent state at failure. It may share the same underlying V2 pre-create eviction defect as #33777; I am not claiming a proven different root cause. The value of keeping this report linked is the directly uploaded reproduction and exact lifecycle evidence. Maintainers can decide whether to retain it as a separate reproduction or consolidate it into #33777.