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

Resolved 💬 1 comment Opened Jul 25, 2026 by CubeLander Closed Jul 25, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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_

View original on GitHub ↗

1 Comment

github-actions[bot] contributor · 1 month ago

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

  • #34809

Powered by Codex Action