Preserve and resume the full subagent tree when resuming a paused main agent thread
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
- Start a main agent thread.
- Spawn a subagent.
- Pause or suspend the main thread while the subagent exists.
- Resume the main thread.
- 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:
- Previously active subagents appear in the agent tree.
- Their identities and parent/child relationships are unchanged.
- Their prior context and pending messages remain available.
- They can continue from the point at which the tree was paused.
- No subagent is silently discarded unless the user explicitly selected that behavior.
---
Additional information
_No response_
1 Comment
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action