Skip to content

Codex Desktop leaves headless Playwright/Chrome workers running after session close, causing macOS replayd to stay at ~150% CPU #28352

Open

Description

@shm048

What version of the Codex App are you using (From “About Codex” dialog)?

26.609.41114 (3888)

What subscription do you have?

ChatGPT Pro

What platform is your computer?

23.4.0 arm64 arm macOS 14.4.1 (23E224), Apple Silicon

What issue are you seeing?

Codex Desktop visual/browser/computer-use sessions can leave hidden Playwright/Chrome workers running after the session appears closed. These orphaned workers keep macOS replayd active at very high CPU usage, causing rapid battery drain and device heating.

Observed on my machine:

  • replayd stayed around ~150-160% CPU after Codex sessions were closed in the UI.
  • Two hidden/headless Chrome processes remained active, using ~20% CPU each.
  • Both were children of a Codex node worker.
  • The hidden Chrome processes were launched with Playwright/headless flags such as:
    • --headless
    • --remote-debugging-pipe
    • --no-startup-window
    • --user-data-dir=/var/folders/.../playwright_chromiumdev_profile-*
    • --enable-features=CDPScreenshotNewSurface

The parent worker looked like:

/Applications/Codex.app/Contents/Resources/cua_node/bin/node --experimental-vm-modules ... --session-id ... --working-dir /Users/saurabh/Documents/GitHub/bioq-one-app

### What steps can reproduce the bug?

I do not yet have a minimal deterministic reproduction, but this is the sequence that produced the issue:

1. Start Codex Desktop on macOS.
2. Run one or more Codex sessions that use visual/browser/computer-use behavior, such as visual audit, screenshots, browser inspection, or local app testing.
3. Close or stop those Codex sessions from the UI.
4. Observe macOS Activity Monitor or run:
   ```bash
   ps -axo pid,ppid,pcpu,pmem,stat,comm,args | sort -k3 -nr | head -25
   ps -axo pid,ppid,pcpu,pmem,stat,comm,args | grep -i 'replayd\|playwright\|headless\|Codex'

In the failing state, replayd remains at ~150-160% CPU and hidden Playwright/headless Chrome workers remain alive under a Codex node process.
Kill the stale Codex worker and observe replayd return to idle:kill <codex-node-worker-pid> <headless-chrome-child-pids>
# if the parent remains:
kill -9 <codex-node-worker-pid>

In my case, the stale processes were:
Codex node worker: 23090
Headless Chrome children: 23091, 23601
After killing those, replayd dropped from ~156% CPU to 0.0% and stayed idle.

### What is the expected behavior?


**Expected behavior**
```md
When a Codex visual/browser/computer-use session stops, closes, errors, or is no longer visible in the UI, Codex should terminate all related Playwright/headless Chrome workers and release any screen-capture resources.

macOS `replayd` should return to idle automatically without requiring the user to manually find and kill hidden Codex worker processes.

### Additional information

Environment:
- Codex App: 26.609.41114 (3888)
- macOS: 14.4.1 (23E224)
- Platform: `23.4.0 arm64 arm`
- Hardware: Apple Silicon MacBook Air, 8 GB RAM

Important control test:
I initially suspected Wispr Flow because it also has audio/video capture helper processes. However, after killing the stale Codex Playwright workers, I opened Wispr Flow and left it idle. `replayd` remained at `0.0%`. This suggests Wispr was not the stuck cause.

The strong evidence is:
- Before killing stale Codex workers: `replayd` ~150-160% CPU.
- After killing stale Codex Playwright/headless Chrome workers: `replayd` immediately dropped to `0.0%`.
- No macOS thermal warning was recorded, but battery drain and device heat were significant.

Suggested fix:
Codex should track all child Playwright/Chromium processes spawned by visual/browser/computer-use sessions and reliably clean them up when the session ends. It would also help to expose a UI command such as "Stop all browser/computer-use workers" or automatically reap orphaned Playwright workers after a timeout.

Activity

  1. added
    appIssues related to the Codex desktop app
    on Jun 15, 2026
  2. github-actions commented on Jun 15, 2026

    @github-actions
    Contributor
  3. shm048 commented on Jun 15, 2026

    @shm048
    Author

    I reviewed the potential duplicates:

    This issue appears related but distinct because the leaked processes here are headless Playwright/Chrome workers spawned by visual/browser/computer-use behavior, and the user-visible impact is macOS replayd staying at ~150-160% CPU.

    The key additional evidence is that killing the stale Codex Playwright worker and its headless Chrome children immediately dropped replayd from ~156% CPU to 0.0%.

    So this may share the same parent lifecycle/cleanup problem as #26773/#26869, but it likely needs coverage for browser/computer-use workers specifically, including releasing macOS screen-capture resources.

  4. AgeratumStudio commented on Oct 6, 2026

    @AgeratumStudio

    Windows reproduction of this issue.

    Environment:

    • Codex Desktop on Windows 11
    • NVIDIA RTX 3070
    • Observed on 2026-10-06

    After a Codex task using browser / Computer Use finished, the PC became loud and started lagging. I inspected the process tree and sampled system load.

    Observed:

    • Total CPU: 89.7%
    • RAM used: 51.8%
    • RTX 3070 GPU utilization: 0%
    • GPU temperature: 40 C
    • One hidden chrome.exe process: ~76.8% CPU, ~208 MB RAM

    The Chrome process was not my normal browser. Its parent chain led back to the Codex Computer Use runtime:

    %LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\...\node.exe
      -> Playwright headless Chrome
      -> Chrome GPU process
    

    Relevant Chrome flags included:

    --headless
    --use-angle=swiftshader
    --enable-unsafe-swiftshader
    --user-data-dir=%TEMP%\playwright_chromiumdev_profile-*
    

    The high-CPU Chrome worker remained alive after the Codex task had already finished. GPU utilization stayed at 0%, while the hidden Chrome worker consumed most of the CPU.

    Expected:
    When the browser / Computer Use task ends, all associated Playwright/Chrome workers should terminate or return to idle.

    Actual:
    The hidden worker survives task completion and continuously consumes CPU until manually terminated / the process tree is cleaned up.

    This looks like the same lifecycle / cleanup class reported here, but reproduced on Windows with the bundled cua_node runtime rather than macOS.

    Possibly related Windows process-lifecycle report: #38714.

    I can provide additional sanitized process-tree diagnostics if useful.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions