Skip to content

macOS: visible Codex window drives WindowServer to 36–41% CPU on M4 MacBook Air #32024

Open

Description

@MichaelLin2001

Summary

On an Apple M4 MacBook Air, opening the visible ChatGPT/Codex desktop window consistently drives WindowServer to sustained high CPU and makes the machine noticeably hot. Closing or hiding the window drops the load immediately.

This appears to be a visible-window rendering/compositing issue rather than agent execution, SSH, or a general macOS power setting.

Environment

  • Codex / ChatGPT desktop app: 26.707.31428 (build 5059)
  • macOS: 26.5.2 (25F84)
  • Hardware: Apple M4 MacBook Air, built-in 2560x1664 display only
  • No external display connected during the reproduction

Reproduction

  1. Start ChatGPT/Codex Desktop normally.
  2. Open a Codex task and leave the app window visible.
  3. Observe Activity Monitor.
  4. Hide or close the Codex window.
  5. Observe that WindowServer falls immediately; restore/show the window and it rises again.

Observed

With the window visible:

  • WindowServer: approximately 36% to 41.5% CPU
  • ChatGPT/Codex main process: approximately 10% to 12% CPU
  • Codex GPU service: approximately 4% to 6% CPU
  • Codex renderer: normally a few percent, with higher spikes while the task UI updates

When the ChatGPT/Codex window is closed/hidden, WindowServer drops to about 10% CPU. Opening the visible window brings it back to roughly 36% to 41%.

The issue persisted after fully restarting the app. A long, tool-output-heavy task increases renderer load further, but the visible blank/new task window still keeps WindowServer abnormally high.

Notes

Expected behavior

An idle or lightly used visible Codex Desktop window should not keep WindowServer, the GPU service, and renderer CPU high enough to heat a fanless MacBook Air.

Activity

  1. added
    bug
    app
    on Jul 10, 2026
  2. github-actions commented on Jul 10, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. BobH233 commented on Jul 18, 2026

    @BobH233

    I can reproduce this issue on a newer Codex desktop build and different Apple Silicon hardware.

    Environment

    • ChatGPT/Codex desktop app: 26.715.31251 (build 5538)
    • Chromium: 150.0.7871.124
    • macOS: 26.5.2 (25F84)
    • Hardware: MacBook Pro with Apple M3 Max, 40-core GPU
    • Displays initially connected:
      • Built-in 3456 × 2234 Liquid Retina XDR display
      • ASUS PA279, 3840 × 2160, rotated 90°, scaled to 1080 × 1920 at 60 Hz

    Observed behavior

    With the Codex desktop app open and visible:

    • Activity Monitor showed approximately 60% GPU usage attributed to WindowServer.
    • WindowServer remained at approximately 42–70% CPU during repeated samples.
    • The Codex Chromium GPU process reached approximately 20–22% CPU.
    • The main Codex renderer reached approximately 17% CPU.
    • The machine stayed under this load even when no intensive agent operation was running.

    Closing the Codex desktop app caused GPU usage to return to normal immediately. Reopening the app caused the high WindowServer, Codex GPU, and renderer load to return.

    Isolation performed

    I initially suspected remote-desktop software and the external display, but neither was the primary cause:

    1. Fully closed the active RustDesk and ToDesk sessions.
      • WindowServer remained around 44–59% CPU.
    2. Physically disconnected the external ASUS display and waited for the display configuration to settle.
      • Only the built-in display remained online.
      • WindowServer still remained around 50–70% CPU.
    3. Closed the ChatGPT/Codex desktop app.
      • GPU usage immediately returned to normal.

    This strongly points to the visible Codex desktop UI/compositor path rather than remote-desktop capture or the external display.

    Relevant WindowServer logs

    The following error was emitted continuously while Codex was open:

    WindowServer: _CGXPackagesSetWindowConstraints: Invalid window
    

    Additional diagnostics showed:

    PKGWindowMoveOnMatchingDisplayChangedSeed failed to move window ... (invalid seed a0)
    

    There were more than 14,000 related WindowServer errors, all emitted from the same WindowServer main thread. The error rate remained above 150 events per minute after disconnecting the external display.

    This also appears closely related to #30464 and #32501.

    The decisive signal is that closing Codex immediately restores normal GPU usage, while closing other GPU/screen-capture applications or disconnecting the external monitor does not.

  4. Fzhiyu1 commented on Oct 12, 2026

    @Fzhiyu1

    Still reproducible on 26.1007.30912 (M4 Pro, macOS 26.5.1)

    Environment

    • Codex app 26.1007.30912 (Chromium/Electron framework 155.0.8059.40)
    • MacBook Pro, Apple M4 Pro, 48 GB RAM, macOS 26.5.1
    • Built-in 3456x2234 plus an external display at 5120x2880 scaled to 2560x1440 @ 120 Hz

    Observed

    • WindowServer sits at roughly 50 to 80% CPU for minutes at a time. Five samples taken 2 s apart gave 73, 73, 79, 81 and 74%.
    • Codex renderer processes sit at about 10 to 60% CPU, with several renderers open (about 0.5 to 1.2 GB RSS each).
    • The machine was not under memory pressure at the time: swap used about 0.25 MB, with several GB free.

    A/B test (SIGSTOP / SIGCONT, 3 samples each)

    State WindowServer CPU
    Baseline about 51%
    One Codex renderer suspended (client-id=11) about 24 to 30%
    Another renderer suspended (client-id=5) about 37 to 43%
    Both resumed about 48 to 57%

    So most of the WindowServer load follows the Codex renderers. The load is not related to agent work: no build or test was running in the project.

    Related

    Expected: once no turn is streaming, renderer and WindowServer CPU should fall back to near idle.

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

    appbugperformance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions