fix(capture): honor stop during watch transient backoff#193
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 23, 2026, 6:54 PM ET / 22:54 UTC. Summary Reproducibility: yes. Current main and the latest release show raw Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the stop-aware retry sleep change after the remaining macOS CI job completes and maintainer review accepts the bounded validation. Do we have a high-confidence way to reproduce the issue? Yes. Current main and the latest release show raw Is this the best way to solve the issue? Yes. Reusing the existing AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1771d7db349b. Label changesLabel 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
|
|
@clawsweeper[bot]
Added real terminal behavior proof and tightened the regression. Proof command (any macOS host with Swift): bash scripts/prove-watch-transient-stop.shObserved output on this machine: Same stop timing (5ms into the 350ms backoff window): unfixed raw Also tightened PR body now includes a @clawsweeper re-review |
…nsient-stop # Conflicts: # CHANGELOG.md
|
Landed as Maintainer verification:
The maintainer fixup changed the regression fixture to capture one valid frame before injecting the transient error, avoiding the zero-frame contact-sheet failure seen in the original test. It also removed the standalone 198-line source-mutating proof harness; the production-matched Swift regression is now the durable proof. Caveat: no live ScreenCaptureKit transient denial was forced; the test injects the same transient error and synchronizes on entry to the actual retry path. |
Summary
Watch capture sessions could ignore
requestStop()for up to 350ms while backing off from a transient ScreenCaptureKit failure. The transient retry path used rawTask.sleep, unlike the other sleeps in the loop.This routes transient backoff through the existing stop-aware sleep helper with a retry-local timestamp, preserving the full retry delay while allowing a stop request to wake it immediately.
Regression coverage
The focused test now:
Maintainer review removed the standalone 198-line source-mutating proof harness; the production-matched Swift regression is the durable proof.
Verification
git diff --check: cleanorigin/main: cleanCaveat
A live ScreenCaptureKit transient denial is not deterministic enough for a stable test. The regression injects the same transient error only after a valid frame and synchronizes on entry to the retry path.
Related