openai / openai/codex

Stale “Running” subagents cause high CPU usage in Codex Desktop on macOS

Open
#40,947 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug performance subagent
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What issue are you seeing?

In Codex Desktop on macOS, many subagents that have already finished their work continue to be displayed as “Running”.

These stale Running states do not appear to continue consuming model tokens, but they cause a significant increase in local CPU usage, especially when the full subagent list is expanded and visible.

In my case, a long-running main conversation accumulated more than 40 subagents that still show as Running even though their tasks appear to have finished.

The application becomes noticeably less responsive when these stale Running subagents are displayed.

What steps can reproduce the bug?
  1. Open a long-running conversation that has created many subagents.
  2. Wait until the subagents have completed their tasks.
  3. Observe that many completed subagents still remain marked as “Running”.
  4. Open macOS Activity Monitor and filter for Codex processes.
  5. Keep the conversation open for about 1 minute and observe CPU usage.
  6. Expand the subagent list so that about 40+ stale Running subagents are visible.
  7. Observe that CPU usage increases significantly.
  8. Collapse most of the subagent list again and observe that CPU usage decreases.

In my test:

  • Normal view / no expanded agent list:
    • Codex (Service): ~14.5%
    • Codex (Renderer): ~18.4%
Image
  • Only a few Running subagents visible:
    • Codex (Service): ~22.3%
    • Codex (Renderer): ~26.9%
Image
  • About 40+ Running subagents visible:
    • Codex (Service): ~46.4%
    • Codex (Renderer): ~16.9%
Image

Each state was observed for approximately 1 minute rather than using only an instantaneous CPU reading.

What is the expected behavior?

When a subagent finishes its task:

  • Its status should change from “Running” to “Completed” or “Done”.
  • Any unnecessary timers, polling, subscriptions, or status updates associated with the Running state should stop.
  • Completed historical subagents should not cause sustained CPU usage.
  • Expanding a list of completed subagents should not significantly increase Codex Desktop CPU usage.
Additional information

The CPU increase appears to be strongly related to whether the stale Running subagents are visible.

When most of the subagent list is collapsed, CPU usage decreases significantly. When approximately 40+ stale Running entries are visible, Codex (Service) CPU usage rises substantially.

This suggests the issue may not be only a visual animation/rendering problem. The largest increase in my test occurred in Codex (Service), which may indicate repeated status processing, polling, timers, subscriptions, or IPC activity associated with stale Running states.

The subagents do not appear to continue doing meaningful model work or consuming tokens, so this seems to be a local client state/lifecycle issue.

Environment:

  • macOS Silicon
  • Codex Desktop 26.810.52044
  • Long-running main conversation
  • 40+ stale subagents displayed as Running

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.

Research direction

Start by reproducing on macOS with a long-running conversation and about 40 completed subagents, then profile Codex (Service) and Renderer while expanding and collapsing the list. Trace how finished subagents retain their Running state and verify that they become Completed or Done, associated activity stops, and expanding the list no longer causes sustained CPU growth.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, rust
Domain
desktop, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.