macOS Desktop: completed recurring automations retain CUA node_repl workers

Open
#35,582 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
28/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
macos, rust
Domain
desktop

Research direction

Start by reproducing the recurring-automation process count with the supplied ps command and inspect the private CUA spawn site in the ChatGPT Desktop bundle. Consult the public code-mode host runner and app-server integration for lifecycle context. Done means job-owned workers exit and are reaped on every terminal path, or a shared runtime proves its instance count remains bounded and reused.

Written by the indexing model from the issue text.

Description

app automations bug computer-use performance

Summary

Completed recurring automations leave
/Applications/ChatGPT.app/Contents/Resources/cua_node/bin/node_repl
workers alive for hours. These are not zombies: they remain sleeping (S) and
are direct children of one codex app-server.

Environment and evidence

  • macOS, ChatGPT Desktop bundle
  • Parent command:
    /Applications/ChatGPT.app/Contents/Resources/codex -c features.code_mode_host=true app-server --analytics-default-enabled
  • Observed during investigation: 284 node_repl workers, all S, all direct
    children of the same app-server PID
  • Worker elapsed times ranged from about one to eight hours
  • Earlier observation: 268 workers and 806 automation session records that day
  • Worker creation times correlated with recurring-automation executions
  • The executable is a private Desktop resource:
    /Applications/ChatGPT.app/Contents/Resources/cua_node/bin/node_repl

Public Codex repository investigation

The public openai/codex checkout has no cua_node or node_repl source
reference. Its generic code-mode host runner can accept an external host path,
but it is designed to reuse one live host connection per ThreadManager and
already has child kill + wait/reap handling when that shared connection is
dropped.

That model does not account for hundreds of direct node_repl children under
one app-server. The concrete CUA executable selection and per-automation
lifecycle appear to be in the Desktop bundle/private CUA runtime.

This is adjacent to #12491, but it should not be assumed to be fixed by #19753:
#19753 explicitly addresses stdio MCP server shutdown, whereas the observed
workers are cua_node/bin/node_repl direct app-server children.

Reproduction

  1. Restart Desktop and record the baseline node_repl count.
  2. Run a short recurring automation repeatedly and wait for each run to report
    completion.
  3. After each completion, record:
    ps -axo pid,ppid,state,etime,command |
      rg '/Applications/ChatGPT\.app/Contents/Resources/cua_node/bin/node_repl'
    
  4. Wait at least one hour and compare with the baseline.
  5. Expected: no job-owned worker remains after its run reaches a terminal state.
    Actual: the count rises and completed-run workers remain sleeping.

Requested owner investigation

Please route to ChatGPT Desktop / CUA runtime owners, with Codex app-server
code-mode maintainers consulted for integration.

Instrument the private CUA spawn site with:

  • automation job/run ID, spawned PID, parent PID, and spawn call site;
  • terminal reason: complete, cancel, error, channel close, or app-server stop;
  • terminate result and wait/reap result;
  • a bounded per-job registry count.

Do not use global pkill. If workers are job-owned, add a regression test that
runs several short jobs and asserts each owned process exits and is reaped on
all terminal paths. If the runtime is intentionally shared, assert a bounded
single-instance count and prove it is reused rather than recreated per run.

Related

  • #12491
  • #19753
  • #24510
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.