Docs: define nested subagent completion routing and completed-agent retention
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What type of documentation issue is this?
Missing, incorrect, and confusing documentation.
Summary
Codex's public multi-agent documentation, the model-visible tool contract, and
observed runtime behavior do not establish one coherent contract for nested
subagent completion and completed-agent retention.
The model-visible wait_agent description says it waits for a mailbox update
from "any live agent, including queued messages and final-status
notifications." The public multi-agent guide instead describes a subagent's
final response as being delivered to its parent agent. In a nested tree, the
runtime behaved as a one-hop parent mailbox: a grandchild's final was visible
as Completed in the UI and in list_agents, but it did not arrive in the
root agent's wait_agent mailbox.
The same session exposed a second undocumented boundary. A completed role
agent that was still needed for a possible follow-up disappeared when its
parent spawned a sibling. The public documentation describes concurrency in
terms of simultaneously active subagent turns and says there is no fixed limit
on the total number created or tree depth. It does not explain a separate
retained-context limit, when completed agents may be reclaimed, or how an
orchestrator can keep one addressable.
Nested-completion reproduction
- A root agent spawns a packet host.
- The packet host spawns a draft host.
- The draft host sends an explicit message directly to root; root receives
it, proving that direct task messages can cross that level when addressed
explicitly. - The draft host ends its bounded action with its final response.
- The UI records
Completed <canonical draft-host target>, and
list_agentsreports the target as completed with the expected final
payload. - Repeated
wait_agentcalls at root time out without delivering that final. - A diagnostic follow-up confirms that the draft host emitted its final and
observed no send error.
The direct child host's own final does reach root. The discrepancy appears
specifically at descendant depth: global diagnostic visibility is not the
same thing as root-mailbox delivery.
Retention/reclamation reproduction
- Build a tree of root -> packet host -> draft host -> asserter.
- Let the asserter complete, but retain its canonical target because an
auditor may reject and require another turn from that exact asserter. - Have the draft host spawn the auditor.
- The completed asserter disappears from
list_agentsand is no longer
available for the required follow-up.
This happened at a four-agent topology, but the available diagnostics do not
show whether the cause was a slot limit, a completed-agent reclamation policy,
or another lifecycle rule. That ambiguity is part of the documentation gap.
Practical impact
- An orchestrator can see
Completedin the chat trace while waiting forever
for the completion event its tool contract appears to promise. list_agentsis useful as a snapshot but has no documented attestation or
join semantics, so it cannot safely substitute for a mailbox final.- A parent that ends its turn cannot be assumed to relay later child finals to
root. In practice, every non-root parent must remain in a supervisor loop,
wait for each child, and explicitly relay/attest completion upward. - Polling and diagnostic wakes add turns, latency, and tokens without proving
that an entire subtree has quiesced. - Multi-stage workflows that need to revisit a completed specialist can fail
when that specialist is reclaimed without an explicit retire decision. - It is unclear whether waiting agents consume concurrency capacity, whether a
waiting parent protects completed descendants, and when a completed target
remains addressable byfollowup_task.
Requested contract/documentation
Please document (and make the tool descriptions agree on) the following:
- Whether final responses are delivered exactly one hop to the direct parent,
transitively to root, or to both. - Whether
wait_agentobserves only the caller's mailbox, any descendant's
final, or global lifecycle events. - The distinction among an explicit message, a task-control/status message,
a final response, a UICompletedentry, and alist_agentscompleted
snapshot. - The supported join pattern for a subtree. If completion is intentionally
one-hop, show the canonical parent supervisor/relay loop and explain that a
parent must stay waiting until all children have finalized. - When completed agents are retained, when they can be reclaimed, and whether
there is a pin/retain/retire mechanism for an agent needed later. - The separate accounting, if any, for running, waiting, idle, interrupted,
and completed-but-retained agents. Clarify how this relates to
max_concurrent_subagentsand the root-inclusive slot count. - What lifecycle event an orchestrator can treat as authoritative proof that
a particular target's latest turn, or an entire subtree, has finished.
At minimum, if one-hop delivery and opportunistic reclamation are intentional,
the model-visible tool descriptions should say so. A first-class
join_subtree/completion-attestation primitive and an explicit retention
control would make deterministic orchestration much safer.
Related issues
- #15723 covers the related problem that an idle parent is not automatically
resumed when background work completes. - #17569 asks for missing agent-tool documentation generally.
- #33447 and #40211 cover multi-agent configuration/concurrency documentation.
This report is narrower than a general wake-up request and broader than a
configuration-key correction: it asks for the authoritative routing, join,
and retention contract needed to orchestrate a nested tree.
Documentation location
- https://developers.openai.com/api/docs/guides/responses-multi-agent
- The model-visible descriptions of
wait_agent,list_agents,
followup_task, andspawn_agentin a hosted Codex multi-agent session.
Environment
Observed in a hosted Codex multi-agent session on 2026-08-27. The exact runtime
build identifier was not exposed. No private transcript or repository content
is included in this report.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Responses multi-agent guide and the model-visible descriptions for wait_agent, list_agents, followup_task, and spawn_agent. Compare their stated behavior with the nested-completion and retention reproductions, then document one consistent routing, join, lifecycle, and retention contract; done means the guide and tool descriptions agree.
Written by the indexing model from the issue text.
Assessment
- Domain
- ai-infra-agents, documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100