Skip to content

Codex Computer Use leaves ScreenCaptureKit stream running at ~56 FPS, causing high WindowServer GPU on macOS #35659

Description

@vickyzer027-hash

Summary

Codex Desktop's bundled Computer Use runtime can leave a ScreenCaptureKit stream running after the Computer Use interaction/session has ended. The stale stream continued producing roughly 55–56 frames per second with no consumer, driving WindowServer to about 50–60% CPU and 59% GPU on macOS.

Fully quitting Codex clears the condition. Closing the target application or ending the visible Computer Use interaction does not.

Environment

  • macOS 26.5.2 (25F84), arm64
  • Codex Desktop 26.721.41059 (build 5848)
  • Bundled Codex CLI 0.146.0-alpha.3.1
  • Computer Use runtime 26.721.1000502 (build 1000502)
  • One active external display: 2560×1440 at 100 Hz

Reproduction

  1. Launch Codex Desktop on macOS.
  2. Use the bundled Computer Use capability to inspect/control another macOS app.
  3. Finish the interaction and fully quit the target app.
  4. Stop making Computer Use calls and inspect Activity Monitor using All Processes, sorted by % GPU.
  5. Inspect the running Computer Use helpers and recent replayd / SkyComputerUseService unified logs.

The issue may be easier to reproduce after more than one Codex task/thread has loaded Computer Use. In this reproduction, two SkyComputerUseClient event-stream mcp processes remained connected to one SkyComputerUseService.

Actual behavior

After the target app had fully exited:

  • No target-app process remained.
  • WindowServer was approximately 56.6% CPU and 59.4% GPU.
  • Codex's own GPU process was below 1% GPU at the same time.
  • One SkyComputerUseService and two SkyComputerUseClient event-stream mcp processes remained.
  • replayd still reported an active capture session attributed to the SkyComputerUseService PID.

Representative sanitized log evidence:

FigVideoQueueGMStats: 334 frames enqueued in the last 6 seconds
recent frames: enqueued: 335, displayed: 0, evicted: 335
SCCaptureSession setupHealthMonitor: screenframeCount=279
fetchShareableContent... currentProcessID=<SkyComputerUseService PID>

The screenframeCount samples were taken five seconds apart, corresponding to roughly 55–56 captured frames per second. Frames continued to be generated even when none were displayed and all were evicted.

Resetting the current node_repl Computer Use client stopped one capture stream, but another stream continued at the same rate. WindowServer remained around 46–49% CPU during a separate 10-second top sample with no UI automation calls being made.

No GPU reset, GPU hang, AGX timeout, GPU fault, or Metal fault appeared in the same one-hour log window.

Expected behavior

When the Computer Use tool call/turn/session ends and there is no active consumer:

  • its ScreenCaptureKit stream should stop;
  • stale per-thread MCP clients should be disconnected or reaped;
  • SkyComputerUseService should not continue producing frames that are immediately evicted;
  • WindowServer GPU usage should return to its normal idle level.

Workaround

Fully quit Codex with Cmd-Q, wait for SkyComputerUseService and SkyComputerUseClient to exit, and reopen Codex.

Suggested fix

  • Tie each ScreenCaptureKit stream to an explicit consumer/session lifetime.
  • Stop and invalidate the stream when the last consumer disconnects or a turn ends.
  • Add an idle guard: if frames are continuously evicted with no displayed/consumed frames, tear down the stream.
  • Reap stale event-stream mcp clients and prevent multiple abandoned clients from keeping capture alive.
  • Add a regression test that verifies helper count and active ScreenCaptureKit streams return to baseline after a Computer Use turn ends.

Related issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingcomputer-useperformance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions