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

Open 💬 0 comments Opened May 21, 2026 by 92645417d9e5c763259dbebc306e3e

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:

  • #16799 Cross-project, cross-session state leak
  • #23700 Stale Codex subagents
  • #23930 Codex app subagent cards can remain stuck/visible after close while close/readback reports no live agent
  • #23713 Desktop UX for persistent attached agents: attach a top-level session as a subagent to an orchestrator thread

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

View original on GitHub ↗