Skip to content

Preserve and resume the full subagent tree when resuming a paused main agent thread #35368

Closed

Description

@CubeLander

What variant of Codex are you using?

cli

What feature would you like to see?

Feature request

When a main Codex agent thread is paused and later resumed, its active subagents are currently not restored.

Reproduction

  1. Start a main agent thread.
  2. Spawn a subagent.
  3. Pause or suspend the main thread while the subagent exists.
  4. Resume the main thread.
  5. Inspect the agent tree.

Current behavior

Only the main agent is restored. The previously created subagent is no longer present.

This means the resumed main agent may lose:

  • The subagent’s conversation context
  • In-progress execution state
  • Pending or delivered mailbox messages
  • The original parent/child agent-tree structure
  • The ability to continue coordinating with that same subagent instance

Spawning another subagent with the same name does not solve the problem, because it creates a new thread rather than resuming the original one.

Desired behavior

Pausing a main thread should support pausing the entire agent tree. When the main thread is resumed, Codex should restore:

  • Every non-terminated descendant agent
  • Each agent’s conversation and execution context
  • Parent/child relationships
  • Agent statuses
  • Pending inter-agent messages
  • Stable agent identities or handles

Ideally, the UI or API could offer explicit lifecycle choices:

  • Pause/resume entire agent tree
  • Pause/resume main agent only
  • Terminate descendants when pausing

The default should preferably preserve the whole tree, since silently discarding subagents can lose work and violate the user’s mental model of pausing a collaborative session.

Why this matters

Some workflows require the main agent and several subagents to stop together—for example, when temporarily suspending a long investigation, freeing runtime capacity, or continuing the work in a later session.

A handoff file can preserve partial work, but it cannot preserve thread-local context, message queues, or the continuity of the original subagent. Durable agent-tree suspension would make multi-agent workflows substantially safer and more predictable.

Acceptance criteria

After resuming a paused main thread:

  1. Previously active subagents appear in the agent tree.
  2. Their identities and parent/child relationships are unchanged.
  3. Their prior context and pending messages remain available.
  4. They can continue from the point at which the tree was paused.
  5. No subagent is silently discarded unless the user explicitly selected that behavior.

Additional information

No response

Activity

  1. added
    enhancement
    on Jul 25, 2026
  2. added
    CLI
    subagent
    session
    on Jul 25, 2026
  3. github-actions commented on Jul 25, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

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

    CLIenhancementsessionsubagent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions