The main agent is not aware of subagents spawned before context compaction, and reports no way to list them by itself
Open 💬 3 comments Opened May 24, 2026 by Func86
What version of Codex CLI is running?
codex-cli 0.133.0
What subscription do you have?
Pro Lite
Which model were you using?
gpt-5.5 (reasoning xhigh, summaries detailed)
What platform is your computer?
Linux 6.6.114.1-microsoft-standard-WSL2 x86_64 unknown
What terminal emulator and version are you using (if applicable)?
Windows Terminal
Codex doctor report
What issue are you seeing?
- A subagent is spawned to review a set of new plan documents prepared by the main agent for the repo
- The subagent finished, and the main agent updated the documents accordingly
- Context compacted automatically on the main agent
- The main agent did a diff review pass and reported to me
- I asked the main agent, "Can you get back with that subagent and allow one more round of review?"
- The main agent created a new subagent session instead, forking from the main session with all conversations between the main agent and me
- I noticed the issue and questioned the main agent; it reports that "the original subagent id was not available in the compacted context I had"
- I followed up further, and it reports "I can’t retrieve a list of prior spawned sessions with the tools currently exposed. I can only act on an agent id I already know."
- With the subagent ID provided by me from the
/agentscommand, it can then resume the subagent and proceed correctly.
I see this as a mix of multiple issues:
- Awareness of previously spawned subagent IDs may not survive context compaction. I guess this is acceptable/expected if the subagent is not active.
- There is no way for the main agent to list previously spawned subagents when a resume is the correct orchestration.
- In this case, the main agent has the choice to resume the previous subagent (if the ID is available), start a fresh subagent session, or fork the main session with the user. It chose the worst action possible, since this subsequent "review" is not unbiased (as the user requested) at all, with the full conversation history between it and the user.
What steps can reproduce the bug?
Uploaded thread: 019e56bf-f74a-7de1-b0eb-46853ce69173
What is the expected behavior?
The agent should be able to list previously spawned subagents, and actively resume these sessions if beneficial.
Additional information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗