Skip to content

[Bug] spawn_agent hangs indefinitely without returning control #34653

Open

Description

@jimicze

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.

Activity

  1. added
    bugSomething isn't working
    subagentIssues involving subagents or multi-agent features
    tool-callsIssues related to tool calling
    on Jul 22, 2026
  2. github-actions commented on Jul 22, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  3. changed the title [-]spawn_agent hangs indefinitely without returning control[/-] [+][Bug] spawn_agent hangs indefinitely without returning control[/+] on Jul 22, 2026
  4. jimicze commented on Jul 22, 2026

    @jimicze
    Author

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsubagentIssues involving subagents or multi-agent featurestool-callsIssues related to tool calling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions