[BUG] computer-use screenshot fails on macOS Tahoe 26.x — Swift continuation leak
Status Fixed / completed
Reported on v2.1.87
Maintainer reply None cached
Activity 5 comments · opened Mar 30, 2026 · closed Mar 30, 2026
Environment
- macOS Tahoe 26.3 (Build 25D5112c)
- Claude Code 2.1.87
- Max plan, interactive session
- Computer use enabled via /plugin
Bug
screenshot tool fails every time with:
- "Screenshot capture returned nil (permission missing or SCContentFilter failure)"
- Or: timeout after 30s
- Terminal shows:
SWIFT TASK CONTINUATION MISUSE: captureScreenWithExclusion(displayId:width:height:allowedBundleIds:jpegQuality:) leaked its continuation without resuming it
Permissions confirmed
- Screen & System Audio Recording: Terminal ✅, node ✅, Claude ✅
- Accessibility: granted
Proof: ScreenCaptureKit works on Tahoe
Compiled and ran this Swift test — works perfectly, captures 1680x1050:
import ScreenCaptureKit, AppKit
@main struct App {
static func main() async {
let content = try! await SCShareableContent.excludingDesktopWindows(false, onScreenWindowsOnly: true)
let display = content.displays.first!
let filter = SCContentFilter(display: display, excludingWindows: [])
let config = SCStreamConfiguration()
config.width = display.width; config.height = display.height
let image = try! await SCScreenshotManager.captureImage(contentFilter: filter, configuration: config)
print("✅ Works! \(image.width)x\(image.height)")
}
}
Conclusion
The ScreenCaptureKit API works fine on Tahoe. The bug is in computer_use.node — likely the withCheckedContinuation callback not being called on Tahoe, causing the continuation leak.
Other computer-use tools (request_access, open_application) work correctly. Only screenshot is affected.
5 Comments
Additional note: discoverability
The official documentation says to enable computer-use via
/mcp, but on our setupcomputer-usedid NOT appear in the/mcpserver list.We found it in
/plugin(built-in plugins) where it was listed as disabled. After enabling it there, thecomputer-usetools loaded correctly andrequest_access,open_applicationetc. all work. Onlyscreenshotfails due to the continuation leak described above.This might be worth noting in the docs — users looking in
/mcpwon't find it if it's registered as a plugin rather than an MCP server.Root cause found!
The issue is NOT a general ScreenCaptureKit incompatibility with Tahoe. It's a specific edge case with the
including:filter.Findings:
SCContentFilter(display:, excludingWindows: [])(no app filter) → ✅ Works on TahoeSCContentFilter(display:, including: [iTerm2], exceptingWindows: [])(visible app) → ✅ Works on TahoeSCContentFilter(display:, including: [Finder], exceptingWindows: [])(no visible windows) → ❌ Error -3811 "Failed to start stream due to audio/video capture failure"What happens in computer-use:
request_accessgrants Finderscreenshottries to capture withincluding: [Finder]The fix: When using the
including:filter on Tahoe, ensure at least one included app has a visible window, or fall back toexcludingWindows:filter. The continuation should also handle the -3811 error gracefully instead of leaking.Test code used: Same Swift ScreenCaptureKit test as above, but with
SCContentFilter(display:, including: apps, exceptingWindows: [])— works for visible apps, fails for apps without visible windows.Updated diagnosis — root cause confirmed via Desktop comparison
Tested the same
computer-usescreenshot in Desktop app (Electron) — works perfectly. Compared with CLI (Bun runtime) — fails.Key differences found:
| | Desktop (works) | CLI (fails) |
|---|---|---|
| Runtime | Electron | Bun |
| Module |
computer_use.node(universal binary, 925KB) |computer-use-swift.node(embedded via bunfs) || Process | Claude.app with bundle ID
com.anthropic.claudedesktop| Plain executable, no bundle || RunLoop | Electron provides proper RunLoop | Bun may not provide RunLoop for Swift async/await |
| Screen Recording | Granted to Claude.app bundle | Granted to Terminal |
Root cause:
Bun runtime does not provide a proper RunLoop for Swift async/await callbacks. The
computer-use-swift.nodemodule uses ScreenCaptureKit which relies on Swift concurrency (withCheckedContinuation). When the callback fromSCScreenshotManager.captureImagefires, it needs a RunLoop to dispatch back to — Bun doesn't provide one, so the continuation is never resumed → leak → timeout.This explains why:
Suggested fix:
The CLI's
computer-use-swift.nodeneeds to create its ownCFRunLoopdispatch or useDispatchQueue.mainexplicitly rather than relying on the host runtime's RunLoop.Closing — issue resolved. The screenshot failure was caused by Screen Recording permission not being fully picked up by iTerm until a full restart. After restarting iTerm, native computer-use screenshots work correctly on macOS Tahoe 26.3. Apologies for the noise!
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.