Duplicate Started entries for a single subagent in CLI 0.146.0

Open
#36,206 2 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
58/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust
Domain
cli

Research direction

Start by inspecting PR #35363 and commit af7f6f4, then trace how the TUI handles SubAgentActivity ItemStarted and ItemCompleted events. Reproduce the issue with codex-cli 0.146.0 using --no-alt-screen and verify that one spawn_agent call produces exactly one Started entry for each unique subagent.

Written by the indexing model from the issue text.

Description

bug CLI subagent TUI
What version of Codex CLI is running?

codex-cli 0.146.0

What subscription do you have?

Not recorded.

Which model were you using?

Not recorded.

What platform is your computer?

Linux 7.0.0-28-generic x86_64

What issue are you seeing?

The TUI renders two identical Started <agent-path> lines for one actual subagent. The unique agent tree contains one agent, so the duplicate notification is misleading.

Evidence from an isolated TUI session started with --no-alt-screen:

spawn_agent requested once: /root/ui_probe
Started /root/ui_probe
Started /root/ui_probe
unique agent listing: /root/ui_probe (one entry)

The same pattern occurred for three distinct subagents in a separate main session.

What steps can reproduce the bug?
  1. Run Codex CLI 0.146.0 in the TUI (for example, with --no-alt-screen).
  2. Call spawn_agent once to create one subagent.
  3. Observe the TUI notifications and list the active agents.
What is the expected behavior?

One Started <agent-path> entry per unique subagent.

Additional information

Possible regression (inference, not a confirmed root cause): PR #35363, merged shortly before rust-v0.146.0, emits both ItemStarted and ItemCompleted for one SubAgentActivity in commit af7f6f4. The observed TUI behavior may result if both events are rendered as Started; this has not been confirmed by maintainers.

Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.