Skip to content

fix: throttle screen capture to reduce system lag#11

Merged
abrichr merged 1 commit intomainfrom
fix/screen-capture-throttle
Feb 17, 2026
Merged

fix: throttle screen capture to reduce system lag#11
abrichr merged 1 commit intomainfrom
fix/screen-capture-throttle

Conversation

@abrichr
Copy link
Member

@abrichr abrichr commented Feb 17, 2026

Summary

  • The screen reader thread captured screenshots in a tight loop (~100+ fps) with no throttle, causing high CPU/memory pressure and noticeable system lag
  • With action-gated video, only the most recent screenshot matters when an action occurs — capturing faster is pure waste
  • Add SCREEN_CAPTURE_FPS config (default: 10 fps) with time.sleep() throttle
  • Available via env var, Recorder(screen_capture_fps=...), or RecordingConfig
  • Set to 0 for unlimited (legacy behavior)

Test plan

  • 129 tests pass locally
  • Lint clean
  • CI passes

🤖 Generated with Claude Code

The screen reader thread was capturing screenshots in a tight loop with
no frame rate limit, causing high CPU and memory pressure. With action-
gated video, only the most recent screenshot matters when an action
occurs, so capturing at 100+ fps was pure waste.

Add SCREEN_CAPTURE_FPS config (default: 10 fps). The throttle sleeps
for the remainder of the frame interval after each capture. Set to 0
for unlimited (legacy behavior). Also available as screen_capture_fps
param on Recorder constructor and RecordingConfig.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@abrichr abrichr merged commit d7134a8 into main Feb 17, 2026
4 checks passed
@abrichr abrichr deleted the fix/screen-capture-throttle branch February 17, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant