Skip to content

Commit 0b5219d

Browse files
abrichrclaude
andcommitted
feat: make send_profile opt-in CLI flag, add magic-wormhole as regular 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>
1 parent 3cf382e commit 0b5219d

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

openadapt_capture/cli.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def record(
1717
video: bool = True,
1818
audio: bool = False,
1919
images: bool = False,
20+
send_profile: bool = False,
2021
) -> None:
2122
"""Record GUI interactions.
2223
@@ -26,6 +27,7 @@ def record(
2627
video: Capture video (default: True).
2728
audio: Capture audio (default: False).
2829
images: Save screenshots as PNGs (default: False).
30+
send_profile: Send profiling data via wormhole after recording (default: False).
2931
"""
3032
import time
3133

@@ -43,6 +45,7 @@ def record(
4345
capture_video=video,
4446
capture_audio=audio,
4547
capture_images=images,
48+
send_profile=send_profile,
4649
) as recorder:
4750
recorder.wait_for_ready()
4851
try:

openadapt_capture/recorder.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,6 +1372,7 @@ def record(
13721372
num_window_events: multiprocessing.Value = None,
13731373
num_browser_events: multiprocessing.Value = None,
13741374
num_video_events: multiprocessing.Value = None,
1375+
send_profile: bool = False,
13751376
) -> None:
13761377
"""Record Screenshots/ActionEvents/WindowEvents/BrowserEvents.
13771378
@@ -1819,8 +1820,9 @@ def join_tasks(task_names: list[str]) -> None:
18191820
f"FPS={config.SCREEN_CAPTURE_FPS}")
18201821
print("=========================\n")
18211822

1822-
# Auto-send profiling via wormhole
1823-
_send_profiling_via_wormhole(_profile_path)
1823+
# Auto-send profiling via wormhole if requested
1824+
if send_profile:
1825+
_send_profiling_via_wormhole(_profile_path)
18241826
except Exception as exc:
18251827
logger.warning(f"Profiling save/send failed: {exc}")
18261828

@@ -1867,13 +1869,15 @@ def __init__(
18671869
log_memory: bool | None = None,
18681870
plot_performance: bool | None = None,
18691871
screen_capture_fps: float | None = None,
1872+
send_profile: bool = False,
18701873
) -> None:
18711874
from pathlib import Path
18721875

18731876
from openadapt_capture.config import RecordingConfig
18741877

18751878
self.capture_dir = str(Path(capture_dir).resolve())
18761879
self.task_description = task_description
1880+
self._send_profile = send_profile
18771881

18781882
# Build recording config from constructor params
18791883
self._recording_config = RecordingConfig(
@@ -1940,6 +1944,7 @@ def _run_record(self) -> None:
19401944
num_window_events=self._num_window_events,
19411945
num_browser_events=self._num_browser_events,
19421946
num_video_events=self._num_video_events,
1947+
send_profile=self._send_profile,
19431948
)
19441949

19451950
def __enter__(self) -> "Recorder":

pyproject.toml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ dependencies = [
4141
"pympler>=1.0.0",
4242
"tqdm>=4.0.0",
4343
"numpy>=1.20.0",
44+
"magic-wormhole>=0.17.0",
4445
]
4546

4647
[project.optional-dependencies]
@@ -59,14 +60,9 @@ privacy = [
5960
"openadapt-privacy>=0.1.0",
6061
]
6162

62-
# Sharing via Magic Wormhole
63-
share = [
64-
"magic-wormhole>=0.17.0",
65-
]
66-
6763
# Everything
6864
all = [
69-
"openadapt-capture[transcribe-fast,transcribe,privacy,share]",
65+
"openadapt-capture[transcribe-fast,transcribe,privacy]",
7066
]
7167

7268
dev = [

0 commit comments

Comments
 (0)