fix(capture): avoid false-success screen captures#185
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 11, 2026, 10:38 AM ET / 14:38 UTC. Summary Reproducibility: yes. at source level: current main skips permission probing for legacy-first capture and accepts CoreGraphics output without detecting wallpaper-only pixels. This non-macOS review environment cannot independently execute the live reproduction. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Keep the fail-safe behavior, but merge only after final-head evidence demonstrates the affected background-session error and a supported Aqua or Bridge success path, with capture owners accepting the fallback removal. Do we have a high-confidence way to reproduce the issue? Yes at source level: current main skips permission probing for legacy-first capture and accepts CoreGraphics output without detecting wallpaper-only pixels. This non-macOS review environment cannot independently execute the live reproduction. Is this the best way to solve the issue? Yes in principle: failing rather than returning misleading pixels is the narrowest safe behavior, and the coordinate conversion has focused layout coverage. Merge still needs final-head runtime proof and explicit compatibility acceptance. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7c3862b03285. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Addressed the P1 fallback concern in |
|
@clawsweeper re-review Follow-up pushed in |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Addressed the P1 coordinate finding in I also ran the requested independent subagent review before pushing this update. It flagged my first local version as wrong because it only translated Y; I corrected that to Validation on current head git diff --check
swift build --package-path Apps/CLI
PEEKABOO_INCLUDE_AUTOMATION_TESTS=true swift test --package-path Apps/CLI --filter PermissionsCommandTests
swift test --package-path Core/PeekabooCore --filter ScreenCapturePlannerMatchDisplayTestsRemaining known limitation: fresh inspectable GUI proof is still not included because the console was locked during the fresh attempt; the PR body calls that out explicitly. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Retrying because the prior re-review run for Please re-check the current head |
|
@clawsweeper re-review Maintainer repair and live verification complete on exact head Live behavior proof:
Final validation:
Maintainer fixes also replaced inferred display regions with documented |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Summary
Fixes legacy/CoreGraphics screen and area capture falsely reporting success with wallpaper-only or redacted pixels in non-Aqua/background sessions.
This PR now:
/usr/sbin/screencapture -D <display>for whole displays and-Rfor areasscreencapturedisplay numbers, excluding subordinate mirrored displaysCGDisplayCreateImagefallbacks for screen and area capturescreencaptureerrors and fails closedpeekaboo permissions request-screen-recordingfor the current local CLI binaryRoot cause
Legacy capture skipped the normal Screen Recording gate and could fall back to CoreGraphics APIs that returned plausible image files containing only wallpaper or redacted pixels. Automation received a successful result even though the image did not represent the visible desktop.
The repaired path checks permission first, uses the native capture utility, and returns a permission/native capture error instead of accepting unsafe fallback pixels.
Validation
Final head:
b0e9f76e6c8f8dd15495e5cfb8b89ae98bc3dfacResults:
Live proof
Active Aqua session:
Background launchd session over localhost SSH:
PERMISSION_ERROR_SCREEN_RECORDINGPERMISSION_ERROR_SCREEN_RECORDINGBaseline comparison:
/usr/sbin/screencapturein that Background session exited 1 withcould not create image from displayThe final permission-request command is pinned to the local in-process runtime, so it cannot silently request permission on a daemon or Bridge host.
Review follow-up
Maintainer review additionally:
-Rgeometry with documented-Dselection