openai / openai/codex

[macOS] Computer Use captures Stage Manager thumbnail, poisons ScreenCaptureKit stream (-3811/-3812)

Open
#38,348 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug computer-use
Dominant language
Rust
Stars
125k
Forks
19.5k
PR merge metrics
PR metrics pending

Description

Summary

With macOS Stage Manager enabled, Codex Computer Use can select an inactive app's Stage Manager thumbnail instead of its real window. The thumbnail has off-screen/negative window coordinates, so ScreenCaptureKit fails its display lookup. That failed capture can then poison the shared capture service: subsequent captures of unrelated, valid on-screen apps also return SCStreamErrorDomain errors until the service is restarted.

Disabling Stage Manager resolves the issue.

Environment

  • macOS: 27.0 (26A5378n), Apple Silicon / arm64
  • ChatGPT/Codex Desktop: 26.803.61601 (build 6396)
  • Computer Use plugin/runtime: 1.0.1000633
  • Displays: one active built-in display
  • Stage Manager: enabled when reproducing
  • Screen Recording and Accessibility permissions: enabled for ChatGPT and Codex Computer Use
  • Feedback session: 019ffaa1-04c8-7f82-a598-5ffa29e6aa2d

Actual behavior

Computer Use initially returned a screenshot for TextEdit, but it was a distorted Stage Manager thumbnail rather than the full application window.

Unified ScreenCaptureKit logs showed the selected thumbnail outside the active display:

SCContentFilter setContentsAndStreamTypeMacOS:
failed display lookup for windowBounds=<private> cgError=0 found=0

contentRect=[x=-271.000000 y=701.000000 width=154.000000 height=122.000000]

Computer Use then returned:

Computer Use server error -10005:
Error Domain=com.apple.ScreenCaptureKit.SCStreamErrorDomain Code=-3811
"Failed to start stream due to audio/video capture failure"

and later:

Computer Use server error -10005:
Error Domain=com.apple.ScreenCaptureKit.SCStreamErrorDomain Code=-3812
"Failed due to an invalid parameter"

After the TextEdit failure, a previously working Calculator capture also failed with -3812, showing that one invalid Stage Manager target can leave the shared capture service in a bad state.

Restarting only SkyComputerUseService did not reliably recover while Stage Manager remained enabled; the next target capture could immediately fail again.

Reproduction

  1. Enable macOS Stage Manager and leave its recent-app strip visible.
  2. Open TextEdit and Calculator.
  3. Switch away from TextEdit so it appears in the Stage Manager strip.
  4. Ask Codex Computer Use to inspect TextEdit with get_app_state.
  5. Observe either:
    • a distorted/perspective Stage Manager thumbnail screenshot, or
    • SCStreamErrorDomain -3811 / -3812.
  6. Ask Computer Use to inspect Calculator.
  7. Observe that Calculator can now fail with the same capture error even though its window geometry is valid.

Expected behavior

  • Computer Use should activate and capture the real application window, not a Stage Manager thumbnail.
  • Off-screen/thumbnail windows should be rejected before constructing the ScreenCaptureKit content filter.
  • A failed window capture should not corrupt later captures for other applications.
  • On -3811 or -3812, the service should discard the invalid filter/stream state and recover automatically.

Workaround and validation

  1. Disable Stage Manager in System Settings > Desktop & Dock.
  2. Restart the dedicated Computer Use capture service.
  3. Re-run captures.

After disabling Stage Manager:

  • TextEdit changed from the distorted thumbnail to a normal full-window screenshot.
  • Six alternating get_app_state calls across TextEdit and Calculator all succeeded.
  • No new failed display lookup or SCStreamErrorDomain messages appeared in the verification window.

Suggested guards

  • Exclude Stage Manager strip thumbnails from candidate target windows.
  • Validate that a target window intersects an active SCDisplay before creating SCContentFilter.
  • Prefer an actual on-screen standard window over off-screen/transformed representations of the same app.
  • Recreate SCShareableContent, SCContentFilter, and stream state after -3811 / -3812.
  • Add a regression test where an app is in the Stage Manager recent-app strip, followed by a capture of a separate on-screen app.

Related issues

  • #30846 reports the same generic -3811 wrapper, but with a different suspected trigger (audio entitlement/helper lifecycle). This report includes a deterministic Stage Manager/off-screen-window trigger and the additional -3812 poisoned-stream behavior.
  • #37115 covers a separate Computer Use PiP/Stage Manager focus-stealing interaction.

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

No repository files or tests are named. Start at the Computer Use get_app_state capture path and SkyComputerUseService, then trace ScreenCaptureKit target selection and stream recovery for off-screen Stage Manager thumbnails and -3811/-3812 errors. Done means real windows are selected, invalid targets are rejected, later captures recover, and the Stage Manager regression scenario passes.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.