[macOS] Computer Use captures Stage Manager thumbnail, poisons ScreenCaptureKit stream (-3811/-3812)
Nobody has claimed this yet.
- 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(build6396) - 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
- Enable macOS Stage Manager and leave its recent-app strip visible.
- Open TextEdit and Calculator.
- Switch away from TextEdit so it appears in the Stage Manager strip.
- Ask Codex Computer Use to inspect TextEdit with
get_app_state. - Observe either:
- a distorted/perspective Stage Manager thumbnail screenshot, or
SCStreamErrorDomain -3811/-3812.
- Ask Computer Use to inspect Calculator.
- 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
-3811or-3812, the service should discard the invalid filter/stream state and recover automatically.
Workaround and validation
- Disable Stage Manager in System Settings > Desktop & Dock.
- Restart the dedicated Computer Use capture service.
- Re-run captures.
After disabling Stage Manager:
- TextEdit changed from the distorted thumbnail to a normal full-window screenshot.
- Six alternating
get_app_statecalls across TextEdit and Calculator all succeeded. - No new
failed display lookuporSCStreamErrorDomainmessages appeared in the verification window.
Suggested guards
- Exclude Stage Manager strip thumbnails from candidate target windows.
- Validate that a target window intersects an active
SCDisplaybefore creatingSCContentFilter. - 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
-3811wrapper, but with a different suspected trigger (audio entitlement/helper lifecycle). This report includes a deterministic Stage Manager/off-screen-window trigger and the additional-3812poisoned-stream behavior. - #37115 covers a separate Computer Use PiP/Stage Manager focus-stealing interaction.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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