YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
fix(ci): restore main formatting and wayland fixture
Louis Beaumont87cdbd4446d8
diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.ymlindex c54eba148..4c5e92c19 100644--- a/.github/workflows/e2e-test.yml+++ b/.github/workflows/e2e-test.yml@@ -655,7 +655,7 @@ jobs:cat > "$RUNNER_TEMP/sway/config" <<EOFoutput * resolution 1280x720- exec foot --title "$SCREENPIPE_WAYLAND_TEST_TITLE" sh -lc 'sleep 300'+ exec foot --title "$SCREENPIPE_WAYLAND_TEST_TITLE" sh -lc 'sleep 1800'EOFsway --config "$RUNNER_TEMP/sway/config" --validatediff --git a/crates/screenpipe-audio/src/audio_manager/device_monitor.rs b/crates/screenpipe-audio/src/audio_manager/device_monitor.rsindex 4d3e7dc40..bb788d283 100644--- a/crates/screenpipe-audio/src/audio_manager/device_monitor.rs+++ b/crates/screenpipe-audio/src/audio_manager/device_monitor.rs@@ -1087,9 +1087,7 @@ pub async fn start_device_monitor(// then mis-logged as "restored" with a// backoff reset — a 2s log/reset storm.// Skip this tick entirely, no log, no reset.- if audio_manager- .suspended_devices()- .contains(&device_name)+ if audio_manager.suspended_devices().contains(&device_name){// leave backoff untouched} else if user_disabled.contains(&device_name) {@@ -1196,9 +1194,7 @@ pub async fn start_device_monitor(// log, no reset (must NOT `continue`, which// would skip the rest of the monitor pass// incl. the piggyback sweep itself).- if audio_manager- .suspended_devices()- .contains(&device_name)+ if audio_manager.suspended_devices().contains(&device_name){// leave backoff untouched} else {@@ -1206,7 +1202,8 @@ pub async fn start_device_monitor("[DEVICE_RECOVERY] no output device running (attempt {}), starting default: {}",output_recovery_backoff.attempts, device_name);- match audio_manager.start_device(&default_output).await {+ match audio_manager.start_device(&default_output).await+ {Ok(()) => {failed_devices.remove(&device_name);default_tracker.last_output =@@ -1716,11 +1713,12 @@ pub async fn start_device_monitor(// meetings (experimental flag). Owns its own fallback — every// failure path lands on the stable capture. Pure decider in// meeting_piggyback.rs; this call only applies side effects.- let piggyback_far_end_active = super::meeting_piggyback::run_meeting_piggyback_sweep(- &audio_manager,- &mut piggyback_state,- )- .await;+ let piggyback_far_end_active =+ super::meeting_piggyback::run_meeting_piggyback_sweep(+ &audio_manager,+ &mut piggyback_state,+ )+ .await;// Capture whichever render endpoint audio actually plays// through, and notify if a meeting's speaker audio isn'tdiff --git a/crates/screenpipe-audio/src/audio_manager/manager.rs b/crates/screenpipe-audio/src/audio_manager/manager.rsindex f7133d93b..1436420b8 100644--- a/crates/screenpipe-audio/src/audio_manager/manager.rs+++ b/crates/screenpipe-audio/src/audio_manager/manager.rs@@ -1784,12 +1784,7 @@ impl AudioManager {// Defensive: never clean up a session device here. `check_stale_recording_handles`// already omits them from the stale list (the only caller), but guard the// public entry point too — only `stop_session_device` may tear these down.- if self- .session_devices- .read()- .unwrap()- .contains(device_name)- {+ if self.session_devices.read().unwrap().contains(device_name) {debug!("cleanup_stale_device({device_name}): session device, leaving intact (only stop_session_device may cull it)");diff --git a/crates/screenpipe-audio/src/audio_manager/meeting_piggyback.rs b/crates/screenpipe-audio/src/audio_manager/meeting_piggyback.rsindex cdcbc8c91..5384d8081 100644--- a/crates/screenpipe-audio/src/audio_manager/meeting_piggyback.rs+++ b/crates/screenpipe-audio/src/audio_manager/meeting_piggyback.rs@@ -498,10 +498,14 @@ pub(crate) struct PiggybackObservation {#[derive(Debug, PartialEq, Eq)]pub(crate) enum PiggybackAction {- StartTap { pids: Vec<i32> },+ StartTap {+ pids: Vec<i32>,+ },/// Stop + immediately restart the tap over a new pid set — a deliberate/// rebuild, NOT a failure: no strike, no cooldown gap, suspensions kept.- RetapForPidChange { pids: Vec<i32> },+ RetapForPidChange {+ pids: Vec<i32>,+ },StopSessionDevice(String),Suspend(String),Resume(String),@@ -931,7 +935,9 @@ pub(crate) async fn run_meeting_piggyback_sweep(state: &mut PiggybackState,) -> bool {use super::now_ms;- use crate::core::device::{parse_audio_device, AudioDevice, DeviceType, MEETING_TAP_DEVICE_NAME};+ use crate::core::device::{+ parse_audio_device, AudioDevice, DeviceType, MEETING_TAP_DEVICE_NAME,+ };use screenpipe_events::AudioCaptureHealthEvent;use tracing::{error, info, warn};@@ -1098,9 +1104,8 @@ pub(crate) async fn run_meeting_piggyback_sweep(telemetry.mic_resolved_devices.extend(resolved_inputs.iter().cloned());- telemetry.mic_session_started |= resolved_inputs- .iter()- .any(|d| session_devices.contains(d));+ telemetry.mic_session_started |=+ resolved_inputs.iter().any(|d| session_devices.contains(d));}// 5. Apply actions in the decider's order. Suspend sets the flag BEFORE@@ -1251,8 +1256,7 @@ pub(crate) async fn run_meeting_piggyback_sweep(let ev = AudioCaptureHealthEvent::mic_capture_failed(e.to_string(),);- let _ =- screenpipe_events::send_event(ev.event_name(), ev);+ let _ = screenpipe_events::send_event(ev.event_name(), ev);state.mic_fail_reported = true;} else {warn!(@@ -1759,7 +1763,9 @@ mod tests {// CoreAudio, so there is nothing left to wait for.assert_eq!(m.tick(&obs),- vec![MicFollowAction::OpenSessionInput("Rode NT (input)".to_string())]+ vec![MicFollowAction::OpenSessionInput(+ "Rode NT (input)".to_string()+ )]);assert!(!m.note_open_result("Rode NT (input)", true, obs.now_ms));assert!(m.is_capturing("Rode NT (input)"));@@ -1805,9 +1811,12 @@ mod tests {obs.running_inputs = vec![mic.clone(), other.clone()];obs.running_streaming = [mic.clone()].into();// First pass: adopt + latch displacement of the other mic.- assert_eq!(m.tick(&obs), vec![MicFollowAction::SuspendInput(other.clone())]);+ assert_eq!(+ m.tick(&obs),+ vec![MicFollowAction::SuspendInput(other.clone())]+ );obs.running_inputs = vec![mic.clone()]; // the sweep stopped `other`- // 25 ticks (~50s) of liveness flapping: strictly zero actions.+ // 25 ticks (~50s) of liveness flapping: strictly zero actions.for i in 0..25 {obs.now_ms += TICK_MS;if i % 2 == 0 {@@ -1828,7 +1837,10 @@ mod tests {let mic = "Rode NT (input)".to_string();let mut obs = mf_obs(TICK_MS);obs.resolved_inputs = vec![mic.clone()];- assert_eq!(m.tick(&obs), vec![MicFollowAction::OpenSessionInput(mic.clone())]);+ assert_eq!(+ m.tick(&obs),+ vec![MicFollowAction::OpenSessionInput(mic.clone())]+ );assert!(!m.note_open_result(&mic, false, obs.now_ms));// An event wake inside the retry floor must NOT duplicate the open —@@ -1880,7 +1892,10 @@ mod tests {}obs.now_ms += TICK_MS;}- assert_eq!(warned, 1, "persistent-failure warning must fire exactly once");+ assert_eq!(+ warned, 1,+ "persistent-failure warning must fire exactly once"+ );// Fast window: every retry inside the first MIC_PERSISTENT_WINDOW_MS// arrived at tick cadence (2s) — never slower.@@ -1902,7 +1917,10 @@ mod tests {.filter(|w| w[0] >= start + MIC_PERSISTENT_WINDOW_MS + 2 * TICK_MS).map(|w| w[1] - w[0]).collect();- assert!(slow_gaps.len() >= 2, "expected slow-cadence retries: {opens:?}");+ assert!(+ slow_gaps.len() >= 2,+ "expected slow-cadence retries: {opens:?}"+ );assert!(slow_gaps.iter().all(|gap| *gap >= MIC_PERSISTENT_RETRY_MS),"persistent failures must retry no faster than {}s: {slow_gaps:?}",@@ -1924,15 +1942,21 @@ mod tests {// Stream dies: exactly one close…obs.now_ms += TICK_MS;obs.session_streaming.clear();- assert_eq!(m.tick(&obs), vec![MicFollowAction::CloseSessionInput(mic.clone())]);+ assert_eq!(+ m.tick(&obs),+ vec![MicFollowAction::CloseSessionInput(mic.clone())]+ );obs.session_devices.clear(); // the sweep closed it- // …no duplicate open inside the retry floor (event-wake burst)…+ // …no duplicate open inside the retry floor (event-wake burst)…obs.now_ms += MIC_RETRY_FLOOR_MS / 2;assert!(m.tick(&obs).is_empty(), "floor holds after a death");// …then reopen on the very next tick — fast reacquisition, not a// 10-60s backoff.obs.now_ms = 2 * TICK_MS + TICK_MS;- assert_eq!(m.tick(&obs), vec![MicFollowAction::OpenSessionInput(mic.clone())]);+ assert_eq!(+ m.tick(&obs),+ vec![MicFollowAction::OpenSessionInput(mic.clone())]+ );assert!(!m.note_open_result(&mic, true, obs.now_ms));assert!(m.is_capturing(&mic));}@@ -1950,14 +1974,20 @@ mod tests {obs.session_devices = [mic.clone()].into();obs.session_streaming = [mic.clone()].into();// First pass: already open → Capturing + delivering → latch.- assert_eq!(m.tick(&obs), vec![MicFollowAction::SuspendInput(other.clone())]);+ assert_eq!(+ m.tick(&obs),+ vec![MicFollowAction::SuspendInput(other.clone())]+ );obs.running_inputs.clear();let last_delivering = obs.now_ms;// Capture dies for good.obs.now_ms += TICK_MS;obs.session_streaming.clear();- assert_eq!(m.tick(&obs), vec![MicFollowAction::CloseSessionInput(mic.clone())]);+ assert_eq!(+ m.tick(&obs),+ vec![MicFollowAction::CloseSessionInput(mic.clone())]+ );obs.session_devices.clear();// Until the holdoff elapses: reopen attempts only (fast retries, then@@ -2078,7 +2108,10 @@ mod tests {obs.resolved_inputs = vec![mic.clone()];obs.running_inputs = vec![mic.clone(), other.clone()];obs.running_streaming = [mic.clone()].into();- assert_eq!(m.tick(&obs), vec![MicFollowAction::SuspendInput(other.clone())]);+ assert_eq!(+ m.tick(&obs),+ vec![MicFollowAction::SuspendInput(other.clone())]+ );obs.running_inputs = vec![mic.clone()];// The app hangs up its mic (meeting still detected): after the release@@ -2101,7 +2134,10 @@ mod tests {obs.running_inputs = vec![mic.clone(), other.clone()];obs.running_streaming = [mic.clone()].into();// Adopt + latch.- assert_eq!(m.tick(&obs), vec![MicFollowAction::SuspendInput(other.clone())]);+ assert_eq!(+ m.tick(&obs),+ vec![MicFollowAction::SuspendInput(other.clone())]+ );obs.now_ms += TICK_MS;assert!(m.tick(&obs).is_empty(), "latched: no repeat suspend");m.reset();diff --git a/crates/screenpipe-audio/src/core/process_tap/windows.rs b/crates/screenpipe-audio/src/core/process_tap/windows.rsindex 85ad49daa..b898b9f22 100644--- a/crates/screenpipe-audio/src/core/process_tap/windows.rs+++ b/crates/screenpipe-audio/src/core/process_tap/windows.rs@@ -440,9 +440,7 @@ fn supervisor_policy(exit: CaptureExit) -> SupervisorStep {match exit {CaptureExit::Disconnected | CaptureExit::TargetExited => SupervisorStep::Stop,CaptureExit::EndpointChanged => SupervisorStep::RebuildNow,- CaptureExit::WaitFailed | CaptureExit::DrainFailed => {- SupervisorStep::RebuildAfterCooldown- }+ CaptureExit::WaitFailed | CaptureExit::DrainFailed => SupervisorStep::RebuildAfterCooldown,}}diff --git a/crates/screenpipe-engine/src/meeting_watcher/audio_process/lifecycle.rs b/crates/screenpipe-engine/src/meeting_watcher/audio_process/lifecycle.rsindex 1f12f5526..801476ab7 100644--- a/crates/screenpipe-engine/src/meeting_watcher/audio_process/lifecycle.rs+++ b/crates/screenpipe-engine/src/meeting_watcher/audio_process/lifecycle.rs@@ -281,8 +281,7 @@ pub(crate) async fn apply_state_action(// here stripped the manual piggyback and false-fired the// sweep's meeting-end edge for one tick. Preserve whatever// the detector currently holds (None if nothing published).- let current_active_meeting =- detector.as_ref().and_then(|d| d.active_meeting());+ let current_active_meeting = detector.as_ref().and_then(|d| d.active_meeting());sync_meeting_flag(true, current_active_meeting, in_meeting_flag, detector);if let Ok(status) = resolve_meeting_status_from(db, manual_meeting).await {emit_meeting_status_changed(&status);diff --git a/crates/screenpipe-engine/src/meeting_watcher/audio_process/mod.rs b/crates/screenpipe-engine/src/meeting_watcher/audio_process/mod.rsindex b260532b5..3e52ba2d9 100644--- a/crates/screenpipe-engine/src/meeting_watcher/audio_process/mod.rs+++ b/crates/screenpipe-engine/src/meeting_watcher/audio_process/mod.rs@@ -366,7 +366,12 @@ pub async fn run_audio_process_meeting_detection_loop(}}}- sync_meeting_flag(active_now, current_active_meeting, &in_meeting_flag, &detector);+ sync_meeting_flag(+ active_now,+ current_active_meeting,+ &in_meeting_flag,+ &detector,+ );interval = if processes.is_empty() {IDLE_POLL_INTERVAL} else {diff --git a/crates/screenpipe-engine/src/meeting_watcher/audio_process/resolve.rs b/crates/screenpipe-engine/src/meeting_watcher/audio_process/resolve.rsindex 30b9e7b6e..0e9e8f346 100644--- a/crates/screenpipe-engine/src/meeting_watcher/audio_process/resolve.rs+++ b/crates/screenpipe-engine/src/meeting_watcher/audio_process/resolve.rs@@ -956,13 +956,9 @@ mod little_arc_exclusion_tests {let profiles = load_detection_profiles();let ax_titles = titles(&["My Docs - Notion", "abc-defg-hij"]);let applescript_titles = titles(&["My Docs - Notion"]);- let candidate = little_arc_meet_candidate_excluding(- "Arc",- &ax_titles,- &applescript_titles,- &profiles,- )- .expect("Little Arc code title should resolve");+ let candidate =+ little_arc_meet_candidate_excluding("Arc", &ax_titles, &applescript_titles, &profiles)+ .expect("Little Arc code title should resolve");assert_eq!(candidate.meeting_url.as_deref(),Some("https://meet.google.com/abc-defg-hij")@@ -989,8 +985,7 @@ mod little_arc_exclusion_tests {fn empty_exclusion_matches_plain_fallback() {let profiles = load_detection_profiles();let ax_titles = titles(&["abc-defg-hij"]);- let with_empty =- little_arc_meet_candidate_excluding("Arc", &ax_titles, &[], &profiles);+ let with_empty = little_arc_meet_candidate_excluding("Arc", &ax_titles, &[], &profiles);let plain = little_arc_meet_candidate("Arc", &ax_titles, &profiles);assert_eq!(with_empty.is_some(), plain.is_some());assert!(with_empty.is_some());diff --git a/crates/screenpipe-engine/src/meeting_watcher/audio_process/tests.rs b/crates/screenpipe-engine/src/meeting_watcher/audio_process/tests.rsindex df90b07ae..12e6631cf 100644--- a/crates/screenpipe-engine/src/meeting_watcher/audio_process/tests.rs+++ b/crates/screenpipe-engine/src/meeting_watcher/audio_process/tests.rs@@ -392,18 +392,18 @@ fn meet_code_title_shape_is_strict() {// Anything looser is rejected.for title in ["",- "abc-defg-hi", // last group too short- "abc-defg-hijk", // last group too long- "ab-cdefg-hij", // first group too short- "ABC-DEFG-HIJ", // uppercase- "abc-defg-hi1", // digit- "abc_defg_hij", // wrong separator- "abc-defg-hij ", // trailing whitespace (caller trims)- "Meet - abc-defg-hij", // code embedded in a longer title- "meet.google.com", // domain, not a code- "one-two-three-four", // hyphenated slug- "new-doc-nov", // 3-3-3 dashed doc name- "\u{0430}bc-defg-hij", // non-ASCII lookalike (Cyrillic а)+ "abc-defg-hi", // last group too short+ "abc-defg-hijk", // last group too long+ "ab-cdefg-hij", // first group too short+ "ABC-DEFG-HIJ", // uppercase+ "abc-defg-hi1", // digit+ "abc_defg_hij", // wrong separator+ "abc-defg-hij ", // trailing whitespace (caller trims)+ "Meet - abc-defg-hij", // code embedded in a longer title+ "meet.google.com", // domain, not a code+ "one-two-three-four", // hyphenated slug+ "new-doc-nov", // 3-3-3 dashed doc name+ "\u{0430}bc-defg-hij", // non-ASCII lookalike (Cyrillic а)] {assert_eq!(arc_window_title_meet_code(title), None, "{:?}", title);}diff --git a/crates/screenpipe-engine/src/routes/meetings.rs b/crates/screenpipe-engine/src/routes/meetings.rsindex fcf650a9e..84d7da605 100644--- a/crates/screenpipe-engine/src/routes/meetings.rs+++ b/crates/screenpipe-engine/src/routes/meetings.rs@@ -694,13 +694,11 @@ pub(crate) async fn start_meeting_handler(// publish the identity with `manual: true` — the piggyback sweep// derives its tap targets from the live mic-holder enumeration for// manual meetings instead of riding the stable path.- detector.set_active_meeting(Some(- screenpipe_audio::meeting_detector::ActiveMeeting {- pid: None,- bundle_id: None,- manual: true,- },- ));+ detector.set_active_meeting(Some(screenpipe_audio::meeting_detector::ActiveMeeting {+ pid: None,+ bundle_id: None,+ manual: true,+ }));}if let Ok(status) = resolve_meeting_status(&state).await {diff --git a/crates/screenpipe-screen/src/browser_utils/macos.rs b/crates/screenpipe-screen/src/browser_utils/macos.rsindex f78dc2644..0e2234c60 100644--- a/crates/screenpipe-screen/src/browser_utils/macos.rs+++ b/crates/screenpipe-screen/src/browser_utils/macos.rs@@ -354,8 +354,7 @@ end tell"#;break;}let window = *window as AXUIElementRef;- let _ =- AXUIElementSetMessagingTimeout(window, AX_PROBE_MESSAGING_TIMEOUT_SECS);+ let _ = AXUIElementSetMessagingTimeout(window, AX_PROBE_MESSAGING_TIMEOUT_SECS);// The focused window shows up here too; string dedupe// keeps the list clean without AX element comparisons.if let Some(url) = self.window_document_url(window) {