You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After a transient ScreenCaptureKit failure, three retry paths sleep with try? await Task.sleep before a second attempt:
ScreenCaptureFallbackRunner.run
ScreenCaptureFallbackRunner.runCapture
ScreenRecordingPermissionChecker.hasPermission
try? swallows CancellationError, so a canceled capture or permission check can still run a full second ScreenCaptureKit attempt after the ~350ms delay.
main still has this behavior. A combined fix was proposed and closed without merge pending a live ScreenCaptureKit proof gate.
Impact
Canceled CLI/MCP capture or permission work can still burn a second SCK call during the transient-denial retry window instead of stopping promptly. Same cancel-swallow class as merged #270 / #271 / #267 / #230.
Authenticated, properly signed live ScreenCaptureKit/TCC evidence on a healthy host showing a real transient denial, cancellation during retry backoff, and no second capture/probe, while the non-canceled control still retries once, or
An owner explicitly waives that live gate.
New live evidence (healthy host, production runner)
On macOS 26.5.2 (arm64), with Screen Recording available, real ScreenCaptureKit works (SCShareableContent and SCStream). A harness linked to production ScreenCaptureFallbackRunner from the fixed branch uses a realSCStreamErrorDomain failure (code -3812, invalid stream geometry). Production ScreenCaptureKitTransientError treats any ScreenCaptureKit-domain error as retryable, so this hits the same ~350ms retry sleep path as other SCK failures.
Harness (on the fix branch):
bash scripts/prove-live-sck-cancel.sh
Transcript (ad-hoc signed harness binary; TeamIdentifier not set):
=== Live ScreenCaptureKit cancel proof (production ScreenCaptureFallbackRunner) ===live SCShareableContent.current: displays=1live seed error: domain=com.apple.ScreenCaptureKit.SCStreamErrorDomain code=-3812 desc=Failed due to an invalid parameterseed is SCK-domain (production classifier matches ScreenCaptureKit domain)Control: no cancel (expect 2 real SCStream start attempts via production runner)control attempts=2 final domain=com.apple.ScreenCaptureKit.SCStreamErrorDomain code=-3812PASS control: non-canceled path retried once (2 real SCK calls)Cancel: cancel ~50ms into 350ms denial sleep (expect 1 real SCStream start attempt)cancel attempts=1 outcome=CancellationErrorPASS cancel: canceled during denial sleep with no second real SCK callALL LIVE CHECKS PASSED
Also still green on that branch:
swift test --package-path Core/PeekabooCore --filter ScreenCaptureFallbackRunnerTests (6/6)
swift test --package-path Core/PeekabooAutomationKit --filter ScreenRecordingPermissionCancelTests (2/2)
Summary
After a transient ScreenCaptureKit failure, three retry paths sleep with
try? await Task.sleepbefore a second attempt:ScreenCaptureFallbackRunner.runScreenCaptureFallbackRunner.runCaptureScreenRecordingPermissionChecker.hasPermissiontry?swallowsCancellationError, so a canceled capture or permission check can still run a full second ScreenCaptureKit attempt after the ~350ms delay.mainstill has this behavior. A combined fix was proposed and closed without merge pending a live ScreenCaptureKit proof gate.Impact
Canceled CLI/MCP capture or permission work can still burn a second SCK call during the transient-denial retry window instead of stopping promptly. Same cancel-swallow class as merged #270 / #271 / #267 / #230.
Prior work
Combined fix head (fork, not on
main):6e1405d0ed6a1615e6b530f2aeeec0d81d51f371onSebTardif:fix/screencapture-retry-honor-cancel.Introduced (retry sleep):
6b2554a6ad017b263bfa4c0406ad8f846db76982(fix(capture): stabilize concurrent live area capture, 2026-05-07).Maintainer re-entry criteria (from #286 closeout)
From @steipete on #286:
New live evidence (healthy host, production runner)
On macOS 26.5.2 (arm64), with Screen Recording available, real ScreenCaptureKit works (
SCShareableContentandSCStream). A harness linked to productionScreenCaptureFallbackRunnerfrom the fixed branch uses a realSCStreamErrorDomainfailure (code-3812, invalid stream geometry). ProductionScreenCaptureKitTransientErrortreats any ScreenCaptureKit-domain error as retryable, so this hits the same ~350ms retry sleep path as other SCK failures.Harness (on the fix branch):
Transcript (ad-hoc signed harness binary; TeamIdentifier not set):
Also still green on that branch:
swift test --package-path Core/PeekabooCore --filter ScreenCaptureFallbackRunnerTests(6/6)swift test --package-path Core/PeekabooAutomationKit --filter ScreenRecordingPermissionCancelTests(2/2)Gaps vs the exact re-entry wording (called out on purpose)
SCStreamErrorDomain-3812from liveSCStream.startCaptureScreenCaptureFallbackRunner-3801/ declined TCC copy)Questions for maintainers
SCStreamErrorDomainand the production retry classifier?Happy to re-open a single combined PR from the existing branch once the gate or waiver is clear. No new PR until then.