feat: conditional window capture + recording profiling with auto-wormhole#12
Open
feat: conditional window capture + recording profiling with auto-wormhole#12
Conversation
… auto-wormhole - Make window reader/writer conditional on RECORD_WINDOW_DATA (defaults to False), eliminating unnecessary thread + process + expensive platform API calls - Add throttle to read_window_events (0.1s) and memory_writer (1s) loops - Add profiling summary at end of record() with duration, event counts/rates, config flags, main thread check, and thread count - Auto-send profiling.json via Magic Wormhole after recording stops Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…evel to WARNING - When window capture is disabled, skip the window timestamp requirement in process_events instead of discarding all action events - Set loguru log level to WARNING by default (was DEBUG) to reduce noise during recording Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
video_post_callback crashes with KeyError 'last_frame' when recording stops before any action triggers a video frame write. Guard against missing state keys and close the container gracefully. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…e compat - Second reference to prev_window_event in process_events was unguarded, causing AttributeError when RECORD_WINDOW_DATA=False - PyAV pict_type="I" raises TypeError on newer versions; fall back to integer constant Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use av.video.frame.PictureType.I instead of string "I" which is unsupported in current PyAV versions - Add test_video.py with tests for frame writing, key frames, and PictureType enum compatibility Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Set matplotlib to non-interactive Agg backend so plotting works from background threads (fixes RuntimeError when Recorder runs record() in a non-main thread) - Improve wormhole-not-found message with install instructions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When the stop sequence was fully matched, the index wasn't reset. Extra keypresses after the match would index past the end of the sequence list, causing IndexError. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…Error - Track screenshot duration (avg/max/min ms) and total iteration duration per screen reader loop iteration in profiling.json - Reset stop sequence index after match to prevent IndexError on extra keypresses Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…r dep Profiling data is no longer auto-sent via wormhole after every recording. Use --send_profile flag to opt in. Also promotes magic-wormhole from optional [share] extra to a regular dependency since sharing is core functionality. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
HTML visualizer referenced these attributes which didn't exist on CaptureSession. Added properties with safe fallbacks and updated html.py to use getattr with defaults. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RECORD_WINDOW_DATA(defaults toFalse), eliminating an unnecessary thread + process + expensive platform API calls during recordingread_window_events(0.1s) andmemory_writer(1s) tight loopsrecord()— savesprofiling.jsonto capture dir with duration, event counts/rates, config flags, whether running on main thread, and thread countprofiling.jsonvia Magic Wormhole after recording stops for easy remote debuggingContext
Investigating why
record_waa_demos.pyis noticeably laggier thanpython -m openadapt_capture.cli recordon Windows. This PR adds instrumentation to compare both paths — after each recording, profiling data is automatically wormhole-sent for analysis.Test plan
🤖 Generated with Claude Code