Closed subagents remain in sidebar until threads are archived
Me: the following issue description is generated by Codex. There was UI issue and codex fixed it by digging into internal. I have the latest codex version as of July 2nd 2026.
Summary
Closed subagents stayed visible in the Codex sidebar and the subagent count kept growing (Show 148 more). close_agent succeeded for individual agents, but the sidebar still listed them.
Local findings
In ~/.codex/state_5.sqlite:
thread_spawn_edgeshad 154 child threads for the workspace- 150 edges were already
closed - 4 edges were stale
openentries, butclose_agentreported those ids as not found - all 154 corresponding
threadsrows hadarchived = 0
So the sidebar appears to count unarchived child threads, not just live subagent workers.
Workaround used
I backed up state_5.sqlite, then archived only the affected workspace's child threads and marked stale edges closed. After that:
remaining_unarchived_children = 0remaining_nonclosed_edges = 0
Expected behavior
When a subagent is closed/completed, it should not keep accumulating in the sidebar indefinitely. There should also be a supported bulk cleanup/archive path for completed subagents.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗