Skip to content

Closed subagents remain in sidebar until threads are archived #30903

Open

Description

@kennyalive

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_edges had 154 child threads for the workspace
  • 150 edges were already closed
  • 4 edges were stale open entries, but close_agent reported those ids as not found
  • all 154 corresponding threads rows had archived = 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 = 0
  • remaining_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.

Activity

  1. added
    bugSomething isn't working
    appIssues related to the Codex desktop app
    subagentIssues involving subagents or multi-agent features
    sessionIssues involving session (thread) management, resuming, forking, naming, archiving
    on Jul 2, 2026
  2. github-actions commented on Jul 2, 2026

    @github-actions
    Contributor
  3. kennyalive commented on Jul 2, 2026

    @kennyalive
    Author

    So far it does not look like a duplicate but if it is, please check if the described workaround can be useful. It fixed the issue for me locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingsessionIssues involving session (thread) management, resuming, forking, naming, archivingsubagentIssues involving subagents or multi-agent features

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions