Skip to content

/agent can show unrelated main sessions as generic "Agent" sub-agents #23937

Open

Description

What version of Codex CLI is running?

0.132.0

What subscription do you have?

ProLite

Which model were you using?

No response

What platform is your computer?

Linux 6.12.65-gentoo x86_64 AMD Ryzen 9 5950X 16-Core Processor

What terminal emulator and version are you using (if applicable)?

tmux on alacritty

Codex doctor report

What issue are you seeing?

In a Codex CLI session, opening /agent sometimes shows entries named simply Agent that are not sub-agents of the current session.

These entries appear to be other top-level/main sessions rather than sub-agents spawned by the current session. They have no meaningful sub-agent nickname/role and are displayed as generic Agent entries in the current session's agent picker.

I am not yet sure whether sub-agents from other sessions can also leak into the current session's /agent view, but I have observed what looks like unrelated main sessions appearing there.

This looks like a session isolation / agent-list routing issue: /agent should only show the current session's main thread and its spawned sub-agent tree, not unrelated loaded threads from other sessions.

Potentially related but not exact duplicates:

Those issues seem adjacent, but I did not find one specifically tracking unrelated main sessions appearing inside a different session's /agent picker.

What steps can reproduce the bug?

I do not have a deterministic minimal reproduction yet, but the observed pattern is:

  1. Start or resume multiple Codex CLI sessions.
  2. In one session, use sub-agents normally, or have other sessions open/loaded in the same Codex environment.
  3. Open /agent in one active main session.
  4. Observe entries named simply Agent that do not correspond to sub-agents spawned by that session.
  5. Those entries appear to be other top-level/main sessions rather than children of the current session.

If useful, I can upload feedback/logs from an affected session.

What is the expected behavior?

/agent should only show agents that belong to the current session:

  • the current main session/thread, if shown by design
  • direct or descendant sub-agents spawned by that session
  • no unrelated top-level/main sessions
  • no agents from unrelated sessions unless explicitly attached by a supported cross-thread orchestration feature

Generic Agent entries from unrelated sessions should not appear in the current session's /agent picker.

Additional information

This is concerning because it looks like cross-session UI/control-plane contamination. Even if transcript contents are not exposed, showing unrelated sessions as sub-agents can cause the user or model to interact with the wrong thread/session.

The symptom is intermittent, so the issue may depend on loaded thread state, app-server event routing, session resume/backfill, or stale in-memory agent navigation state.

Additional information

103-ignore-foreign-thread-notifications.patch

Activity

  1. added
    CLIIssues related to the Codex CLI
    subagentIssues involving subagents or multi-agent features
    sessionIssues involving session (thread) management, resuming, forking, naming, archiving
    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal display
    on May 21, 2026
  2. metabrixkt commented on Jul 22, 2026

    @metabrixkt

    A bit more context that will hopefully get this fixed sooner:

    • Codex TUI by itself: never happened to me
    • Codex TUI via app-server: happens a lot
    • Codex desktop app: did not test

    Still an issue as of v0.145.0

  3. ardasevinc commented on Aug 2, 2026

    @ardasevinc

    still present on codex cli v0.146.0.

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

    CLIIssues related to the Codex CLITUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displaybugSomething 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