test(capture): decouple completion proof from frame cadence - #728
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
PR SummaryLow Risk Overview Tests decouple the “late runner return” scenario from frame cadence: the stub records action completion at launch while still returning after the completion deadline, and asserts late delivery, the recorded completion boundary, and Reviewed by Cursor Bugbot for commit 859b641. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
Codex review: needs maintainer review before merge. Reviewed September 12, 2026, 11:33 PM ET / September 13, 2026, 03:33 UTC. ClawSweeper reviewWhat this changesThe PR gives a delayed-result capture test more sampling headroom and consolidates post-roll deadline validation so boundary tests exercise the production helper. Merge readiness✅ Ready for maintainer review Keep open: this is a focused test reliability improvement absent from the pinned main revision, with no actionable correctness findings. The related merged capture fix does not supersede it. Priority: P3 Review scores
Verification
How this fits togetherPeekaboo’s capture action command records the screen around a child process. It combines recorded process completion, capture deadlines, and retained sample timing to decide whether the resulting artifacts prove post-action coverage. flowchart LR
A[Child command] --> B[Recorded completion time]
B --> C[Post-roll deadline validation]
D[Capture duration cap] --> C
C --> E[Screen sampling]
E --> F[Coverage validation]
F --> G[Result and artifact manifest]
Before mergeNone. Agent review detailsSecurityNone. Review metricsNone. Technical reviewBest possible solution: Keep deadline arithmetic coverage separate from frame scheduling while preserving production capture caps and retained post-action evidence requirements. Do we have a high-confidence way to reproduce the issue? No deterministic live reproduction was established during this read-only review. Main’s fixture leaves only 150 ms for a qualifying sample, supporting the reported scheduling-dependent failure; GitHub confirms the cited CLI test job failed. Is this the best way to solve the issue? Yes. Separating delayed delivery from sampling cadence retains the regression’s purpose, and moving the unchanged guard lets arithmetic tests exercise the production admission path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8ecf8a9159ed. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Main CI's delayed-runner test assumed that a valid frame would begin in the final 150 ms of capture. Under load, the last frame began earlier and finished after the cap, so the new post-action evidence check correctly refused success. That coupled the runner-delivery regression to frame cadence.
Keep the 2.5-second cap and deliberately deliver the runner result after its completion deadline, but record completion early enough to leave sampling headroom. Preserve the success and elapsed-coverage assertions, and add explicit checks for late delivery, the recorded completion boundary, and retained post-action sample proof.
Deadline-edge coverage now calls the same throwing admission helper as production for 50 ms before, exactly at, one nanosecond after, 20 ms after, and overflowing boundaries. Remove the unused Boolean helper that only tests called. Production behavior and error messages are unchanged.
Validation: 22 focused capture tests passed, lint/format/diff checks passed, and isolated Codex review found no actionable P0–P2 findings. The signed, source-stamped CLI at
859b64176b79a437a874f2382d176ecc0da2b8e9ran a real/usr/bin/truechild during local classic screen capture: exit 0, two retained frames, child completion275988000ns, last sample start2032758291ns, and valid retained post-action proof. Captured images were removed after structural verification.Failure evidence: https://github.com/openclaw/Peekaboo/actions/runs/34733287499 (CLI job;
Capture action admits post roll from the runner completion boundary). No assertion, timeout, capture cap, or CI gate was removed or weakened.