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(meetings): confirm browser Slack huddles with call controls (#6992)
Parv9f5e1a0074fb
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/diagnostic_logs.rs b/apps/screenpipe-app-tauri/src-tauri/src/diagnostic_logs.rsindex 852b65f91..d3636c34e 100644--- a/apps/screenpipe-app-tauri/src-tauri/src/diagnostic_logs.rs+++ b/apps/screenpipe-app-tauri/src-tauri/src/diagnostic_logs.rs@@ -396,4 +396,34 @@ mod tests {);}}++ #[tokio::test]+ async fn meeting_scan_failure_survives_rotation_collection_and_redaction() {+ // Emitted by the engine's missing-browser regression; that test also+ // checks this fixture against the real warning, so it cannot drift.+ let diagnostic = include_str!(+ "../../../../crates/screenpipe-engine/tests/fixtures/slack-missing-browser-diagnostic.txt"+ );+ let dir = tempdir().unwrap();+ let current = dir.path().join("screenpipe.2026-09-18.log");+ tokio::fs::write(¤t, diagnostic).await.unwrap();+ tokio::fs::rename(¤t, dir.path().join("screenpipe.2026-09-18.1.log"))+ .await+ .unwrap();+ tokio::fs::write(+ ¤t,+ "INFO recording resumed after restart\nINFO [email protected]\n",+ )+ .await+ .unwrap();++ let files = crate::log_files::collect_log_files(&[dir.path().to_path_buf()]).await;+ let report = redact_files(&owned_log_files(files)).await.unwrap();+ assert!(report.contains("screenpipe.2026-09-18.1.log"));+ assert!(report.contains("could not resolve the browser UI process"));+ assert!(report.contains("meeting start withheld"));+ assert!(report.contains("platform=Slack Huddle"));+ assert!(report.contains("recording resumed after restart"));+ assert!(!report.contains("[email protected]"));+ }}diff --git a/crates/screenpipe-engine/src/meeting_watcher/audio_process/resolve.rs b/crates/screenpipe-engine/src/meeting_watcher/audio_process/resolve.rsindex cd89c7797..ebeebe079 100644--- a/crates/screenpipe-engine/src/meeting_watcher/audio_process/resolve.rs+++ b/crates/screenpipe-engine/src/meeting_watcher/audio_process/resolve.rs@@ -775,12 +775,14 @@ pub(crate) fn acquire_input_processes(/// Platform-agnostic: delegates to `MeetingUiScanner::scan_process` which/// uses AX on macOS, UIA on Windows, and is a no-op on other platforms.#[derive(Debug, Clone, PartialEq, Eq, Hash)]-#[cfg(any(target_os = "macos", target_os = "windows"))]+#[cfg(any(target_os = "macos", target_os = "windows", test))]struct CallSignalScanTarget {session_key: ProcessKey,platform: String,pid: i32,profile_index: usize,+ #[cfg(any(target_os = "macos", test))]+ browser_app: Option<String>,}fn candidate_call_signal_profile<'a>(@@ -789,6 +791,14 @@ fn candidate_call_signal_profile<'a>() -> Option<(&'a MeetingDetectionProfile, usize)> {let (platform, _, _, is_browser) = candidate.call_signal_identity()?;profiles.iter().enumerate().find_map(|(index, profile)| {+ // A browser-only profile can share a platform name with the native+ // profile, whose start policy must remain independent.+ if !is_browser+ && profile.app_identifiers.macos_app_names.is_empty()+ && profile.app_identifiers.windows_process_names.is_empty()+ {+ return None;+ }(platform_name_for_profile(profile, is_browser).eq_ignore_ascii_case(platform)).then_some((profile, index))})@@ -802,7 +812,7 @@ fn candidate_requires_call_signal(.is_some_and(|(profile, _)| profile.requires_call_signal)}-#[cfg(any(target_os = "macos", target_os = "windows"))]+#[cfg(any(target_os = "macos", target_os = "windows", test))]fn call_signal_scan_target(candidate: &ResolvedMeetingCandidate,profiles: &[MeetingDetectionProfile],@@ -817,9 +827,107 @@ fn call_signal_scan_target(platform: platform.to_string(),pid: process.pid?,profile_index,+ #[cfg(any(target_os = "macos", test))]+ browser_app: match candidate {+ ResolvedMeetingCandidate::Browser { browser_app, .. } => Some(browser_app.clone()),+ _ => None,+ },})}+/// CoreAudio commonly identifies a Chromium audio helper. Its AX tree has no+/// browser windows: scan the browser UI process while keeping the evidence+/// keyed to the original microphone session. Do not fall back to the helper+/// when the browser has exited or its UI process cannot be resolved.+#[cfg(any(target_os = "macos", test))]+fn call_signal_scan_pid(+ target: &CallSignalScanTarget,+ resolve_browser: impl FnOnce(&str) -> i32,+) -> Option<i32> {+ let pid = target+ .browser_app+ .as_deref()+ .map(resolve_browser)+ .unwrap_or(target.pid);+ if pid > 0 {+ Some(pid)+ } else {+ warn!(+ platform = %target.platform,+ audio_pid = target.pid,+ "meeting call-control scan could not resolve the browser UI process; meeting start withheld"+ );+ None+ }+}++#[cfg(test)]+mod call_signal_target_tests {+ use super::*;++ #[test]+ fn browser_controls_are_scanned_in_the_ui_process_and_keep_the_audio_session() {+ let process = AudioInputProcess {+ audio_session_id: Some("arc-helper-mic-session".into()),+ audio_object_id: Some(300),+ pid: Some(84),+ bundle_id: Some("company.thebrowser.Browser.helper".into()),+ process_name: Some("Arc Helper".into()),+ owner_app_name: Some("Arc".into()),+ owner_bundle_id: Some("company.thebrowser.Browser".into()),+ first_seen_at_ms: None,+ };+ let session_key = ProcessKey::from_process(&process).unwrap();+ let candidate = ResolvedMeetingCandidate::Browser {+ platform: "Slack Huddle".into(),+ meeting_url: "https://app.slack.com/client/T123/C456".into(),+ browser_app: "Arc".into(),+ session_key: session_key.clone(),+ first_seen_at: Instant::now(),+ process,+ live_evidence: true,+ };+ let profiles = load_detection_profiles();+ let target = call_signal_scan_target(&candidate, &profiles).unwrap();+ assert_eq!(target.session_key, session_key);+ assert_eq!(+ call_signal_scan_pid(&target, |browser| {+ assert_eq!(browser, "Arc");+ 123+ }),+ Some(123)+ );+ let log = tempfile::NamedTempFile::new().unwrap();+ let subscriber = tracing_subscriber::fmt()+ .without_time()+ .with_ansi(false)+ .with_writer(log.reopen().unwrap())+ .finish();+ tracing::subscriber::with_default(subscriber, || {+ assert_eq!(call_signal_scan_pid(&target, |_| -1), None);+ });+ let diagnostic = std::fs::read_to_string(log.path()).unwrap();+ assert!(diagnostic.contains("could not resolve the browser UI process"));+ assert!(diagnostic.contains("meeting start withheld"));+ assert!(diagnostic.contains("platform=Slack Huddle"));+ assert_eq!(+ diagnostic.trim(),+ include_str!("../../../tests/fixtures/slack-missing-browser-diagnostic.txt").trim()+ );+ println!("{diagnostic}");+ assert_eq!(call_signal_scan_pid(&target, |_| 0), None);++ let native = CallSignalScanTarget {+ browser_app: None,+ ..target+ };+ assert_eq!(+ call_signal_scan_pid(&native, |_| panic!("native must use its own PID")),+ Some(84)+ );+ }+}+pub(crate) fn retain_candidates_with_required_call_signal(candidates: &mut Vec<ResolvedMeetingCandidate>,profiles: &[MeetingDetectionProfile],@@ -880,26 +988,42 @@ async fn scan_messaging_call_signals(let scanner = crate::meeting_watcher::shared::scanner::MeetingUiScanner::new();to_scan.into_iter()- .map(|target| {+ .filter_map(|target| {let profile = &profiles[target.profile_index];- let result = scanner.scan_process(target.pid, profile);+ #[cfg(target_os = "macos")]+ let Some(pid) = call_signal_scan_pid(+ &target,+ crate::meeting_watcher::ui_scan::resolve_browser_pid,+ ) else {+ return None;+ };+ #[cfg(not(target_os = "macos"))]+ let pid = target.pid;+ let result = scanner.scan_process(pid, profile);debug!("audio-process meeting detector: call signal scan for {} (pid {}): \is_in_call={}, signals={:?}",- target.platform, target.pid, result.is_in_call, result.matched_signals+ target.platform, pid, result.is_in_call, result.matched_signals);- CallSignalEvidence {+ Some(CallSignalEvidence {session_key: target.session_key,platform: target.platform.to_lowercase(),is_in_call: result.is_in_call,matched_signals: result.matched_signals,- }+ })}).collect()});match tokio::time::timeout(Duration::from_secs(5), scan).await {Ok(Ok(results)) => results,- _ => Vec::new(),+ Ok(Err(error)) => {+ warn!(%error, "meeting call-control scan task failed; meeting start withheld");+ Vec::new()+ }+ Err(error) => {+ warn!(%error, "meeting call-control scan timed out; meeting start withheld");+ Vec::new()+ }}}diff --git a/crates/screenpipe-engine/src/meeting_watcher/audio_process/tests.rs b/crates/screenpipe-engine/src/meeting_watcher/audio_process/tests.rsindex d4e759a61..57f014820 100644--- a/crates/screenpipe-engine/src/meeting_watcher/audio_process/tests.rs+++ b/crates/screenpipe-engine/src/meeting_watcher/audio_process/tests.rs@@ -1419,6 +1419,194 @@ fn browser_google_meet_without_call_signal_is_unchanged() {assert_eq!(candidates.len(), 1);}+// Exercise attribution -> real signal matcher -> session gate -> state machine.+// A title identifies a candidate; it must never stand in for in-call evidence.+fn slack_browser_candidate(live: bool, start: Instant) -> ResolvedMeetingCandidate {+ let profiles = load_detection_profiles();+ let process = arc_process();+ let evidence = [BrowserPageEvidence {+ browser_app: Some("Arc".into()),+ url: Some("https://app.slack.com/client/T123/C456".into()),+ title: Some("Huddles - workspace - Slack".into()),+ }];+ let ax = profiles+ .iter()+ .enumerate()+ .filter(|(_, profile)| {+ live && crate::meeting_watcher::shared::ax_window_matches_meeting(+ None,+ evidence[0].title.as_deref(),+ profile,+ )+ })+ .map(|(profile_index, _)| AxResolvedCandidate {+ browser_app: "Arc".into(),+ profile_index,+ meeting_url: None,+ })+ .collect::<Vec<_>>();+ resolve_process_candidate(+ ProcessKey::from_process(&process).unwrap(),+ start,+ &process,+ &profiles,+ &evidence,+ &ax,+ &[],+ )+}++fn slack_call_evidence(role: &str, label: &str) -> CallSignalEvidence {+ let profiles = load_detection_profiles();+ let profile = profiles+ .iter()+ .find(|p| platform_name_for_profile(p, true) == "Slack Huddle")+ .unwrap();+ let matched_signals = profile+ .call_signals+ .iter()+ .filter(|signal| {+ crate::meeting_watcher::shared::check_signal_match(+ signal,+ role,+ Some(label),+ None,+ None,+ )+ })+ .map(|signal| format!("{signal:?}"))+ .collect::<Vec<_>>();+ CallSignalEvidence {+ session_key: ProcessKey::from_process(&arc_process()).unwrap(),+ platform: "slack huddle".into(),+ is_in_call: matched_signals.len() >= profile.min_signals_required,+ matched_signals,+ }+}++#[test]+fn slack_browser_title_and_unrelated_mic_never_start_a_meeting() {+ let profiles = load_detection_profiles();+ for live in [false, true] {+ for evidence in [+ vec![], // unavailable or timed-out scan+ vec![slack_call_evidence("AXButton", "Start a Huddle")],+ vec![slack_call_evidence("AXButton", "Leave channel")],+ vec![slack_call_evidence("AXButton", "Leave")],+ vec![slack_call_evidence("AXStaticText", "Leave Huddle")],+ ] {+ let start = Instant::now();+ let mut candidates = vec![slack_browser_candidate(live, start)];+ retain_candidates_with_required_call_signal(&mut candidates, &profiles, &evidence);+ let mut state = AudioProcessMeetingState::Idle;+ for elapsed in [0, 1, 5, 30] {+ let (next, action) = advance_audio_process_state(+ state,+ &candidates,+ &candidates,+ start + Duration::from_secs(elapsed),+ CANDIDATE_CONFIRM_WINDOW,+ ENDING_GRACE,+ );+ assert!(+ action.is_none(),+ "live={live}, evidence={evidence:?}: {action:?}"+ );+ assert!(matches!(next, AudioProcessMeetingState::Idle));+ state = next;+ }+ }+ }+}++#[test]+fn slack_browser_starts_only_with_huddle_controls_for_its_session() {+ let profiles = load_detection_profiles();+ for live in [false, true] {+ let start = Instant::now();+ let candidate = slack_browser_candidate(live, start);+ assert!(+ matches!(&candidate, ResolvedMeetingCandidate::Browser { platform, .. } if platform == "Slack Huddle")+ );+ let evidence = slack_call_evidence("AXButton", "Leave Huddle");+ assert!(evidence.is_in_call);+ let mut wrong_session = evidence.clone();+ wrong_session.session_key = ProcessKey::from_process(&chrome_process()).unwrap();+ let mut wrong_platform = evidence.clone();+ wrong_platform.platform = "google meet".into();+ for unrelated in [wrong_session, wrong_platform] {+ let mut candidates = vec![candidate.clone()];+ retain_candidates_with_required_call_signal(&mut candidates, &profiles, &[unrelated]);+ assert!(candidates.is_empty());+ }+ let mut candidates = vec![candidate];+ retain_candidates_with_required_call_signal(&mut candidates, &profiles, &[evidence]);+ assert_eq!(candidates.len(), 1);+ let (state, action) = advance_audio_process_state(+ AudioProcessMeetingState::Idle,+ &candidates,+ &candidates,+ start,+ CANDIDATE_CONFIRM_WINDOW,+ ENDING_GRACE,+ );+ let action = if live {+ action+ } else {+ assert!(action.is_none());+ advance_audio_process_state(+ state,+ &candidates,+ &candidates,+ start + CANDIDATE_CONFIRM_WINDOW,+ CANDIDATE_CONFIRM_WINDOW,+ ENDING_GRACE,+ )+ .1+ };+ assert!(+ matches!(action, Some(AudioProcessStateAction::StartMeeting { platform, .. }) if platform == "Slack Huddle")+ );+ }+}++#[test]+fn native_slack_keeps_its_existing_start_policy() {+ let profiles = load_detection_profiles();+ let mut process = zoom_process();+ process.bundle_id = Some("com.tinyspeck.slackmacgap".into());+ process.owner_bundle_id = process.bundle_id.clone();+ process.process_name = Some("Slack".into());+ process.owner_app_name = process.process_name.clone();+ let candidate = resolve_process_candidate(+ ProcessKey::from_process(&process).unwrap(),+ Instant::now(),+ &process,+ &profiles,+ &[],+ &[],+ &[],+ );+ assert!(+ matches!(&candidate, ResolvedMeetingCandidate::Native { platform, .. } if platform == "Slack")+ );+ let mut candidates = vec![candidate];+ retain_candidates_with_required_call_signal(&mut candidates, &profiles, &[]);+ assert_eq!(candidates.len(), 1);++ let native_profile = profiles+ .iter()+ .find(|p| p.app_identifiers.macos_app_names.contains(&"slack"))+ .unwrap();+ for ignored in ["slack", "huddle", "app.slack.com/huddle"] {+ assert!(meeting_app_is_ignored_with_terms(+ "Slack",+ native_profile,+ &[ignored.into()],+ ));+ }+}+fn whatsapp_process() -> AudioInputProcess {AudioInputProcess {audio_session_id: Some("coreaudio-process:500:input:built-in-mic".to_string()),diff --git a/crates/screenpipe-engine/src/meeting_watcher/shared/ignore.rs b/crates/screenpipe-engine/src/meeting_watcher/shared/ignore.rsindex bf98a1536..f922d3a9f 100644--- a/crates/screenpipe-engine/src/meeting_watcher/shared/ignore.rs+++ b/crates/screenpipe-engine/src/meeting_watcher/shared/ignore.rs@@ -133,18 +133,18 @@ pub(crate) fn url_without_query_or_fragment(url: &str) -> &str {/// Decide whether a browser window belongs to a meeting profile, given its page/// URL (when the browser exposes it) and window title.///-/// URL-first: when a URL is known, ONLY the URL is matched against-/// `browser_url_patterns` (query/fragment stripped). Page titles are never+/// URL-first: match a known URL against `browser_url_patterns`+/// (query/fragment stripped). Page titles are never/// searched for URL patterns — titles carry arbitrary text (an Amazon listing/// for a "Meeting Owl … Certified for Microsoft Teams … Works with Zoom, Google/// Meet" camera, the jitsi-meet GitHub repo, or "meet - App on Amazon Appstore")/// and matching meeting patterns there produces phantom meetings (#4246).////// `browser_title_patterns` (anchored, see `browser_title_matches_pattern`) are-/// a fallback used ONLY when no URL is available — e.g. Arc, which titles its-/// window "Meet" but does not expose the tab URL via AXDocument. When a URL IS-/// available and is not a meeting URL, the page title is not evidence of a-/// meeting.+/// a fallback when no URL is available, or when its parsed HTTP(S) host belongs+/// to the profile. Slack huddles keep a `/client/` URL, so their title identifies+/// a candidate for the required call-control scan, not proof of an active call.+/// A known foreign URL always suppresses the title fallback.pub(crate) fn browser_window_matches_meeting(url: Option<&str>,title: Option<&str>,@@ -153,10 +153,40 @@ pub(crate) fn browser_window_matches_meeting(let ids = &profile.app_identifiers;if let Some(u) = url.map(str::trim).filter(|u| !u.is_empty()) {let doc = url_without_query_or_fragment(u);- return ids+ if ids.browser_url_patterns.iter()- .any(|p| browser_url_pattern_matches(doc, p));+ .any(|p| browser_url_pattern_matches(doc, p))+ {+ return true;+ }+ if let Some(t) = title.filter(|_| !ids.browser_title_patterns.is_empty()) {+ // A hostname in a path, userinfo, query, or fragment is not the+ // page's host. Only allow this fallback on the actual platform.+ let url_on_profile_host = url::Url::parse(u).ok().is_some_and(|url| {+ matches!(url.scheme(), "http" | "https")+ && url.host_str().is_some_and(|host| {+ ids.browser_url_patterns+ .iter()+ .filter_map(|p| p.split('/').next())+ .filter(|p| p.contains('.') && !p.contains(' '))+ .any(|profile_host| {+ host.eq_ignore_ascii_case(profile_host)+ || host+ .strip_suffix(profile_host)+ .is_some_and(|prefix| prefix.ends_with('.'))+ })+ })+ });+ if url_on_profile_host {+ let t_lower = t.to_lowercase();+ return ids+ .browser_title_patterns+ .iter()+ .any(|p| browser_title_matches_pattern(&t_lower, p));+ }+ }+ return false;}if let Some(t) = title {let t_lower = t.to_lowercase();@@ -237,7 +267,7 @@ pub(crate) fn windows_browser_title_match(/// - Anchored `browser_title_patterns` (see `browser_title_matches_pattern`):/// consulted ONLY when the window exposes no page URL, mirroring the/// URL-first rule of `browser_window_matches_meeting`, AND only when the-/// title also carries a Google-Meet-code-shaped token (see+/// Google Meet title also carries a meeting-code-shaped token (see/// `title_contains_meeting_code`). This is what catches a Chrome/Edge Meet/// pop-out titled "Meet – abc-defg-hij" (no AXDocument, no domain in the/// title) without letting a page whose URL is known to be non-meeting@@ -248,11 +278,8 @@ pub(crate) fn windows_browser_title_match(/// anchored-but-ordinary title ("Meet the Team - Acme", "Meet Kevin -/// YouTube", "Meet: quarterly planning") in any open browser window was/// enough live evidence to start a false meeting. Only the Google Meet-/// profile declares `browser_title_patterns` today, and every real-/// Chrome/Edge pop-out title embeds the meeting code, so requiring it costs-/// no genuine detection. The mic-gated URL probe and DB-evidence paths-/// (`browser_window_matches_meeting`) are unchanged, and non-Meet platforms-/// keep their coverage via URL patterns and the Windows UIA path.+/// pop-out title embeds the meeting code. Slack's title only identifies a+/// candidate: its browser profile separately requires huddle call controls.// Only the macOS AX sweep calls this (plus the shared tests).#[cfg(any(target_os = "macos", test))]pub(crate) fn ax_window_matches_meeting(@@ -281,20 +308,37 @@ pub(crate) fn ax_window_matches_meeting({return true;}- if doc.is_none() && title_contains_meeting_code(title) {- let title_lower = title.to_lowercase();- if ids- .browser_title_patterns- .iter()- .any(|p| browser_title_matches_pattern(&title_lower, p))- {- return true;- }+ if doc.is_none() && title_matches_with_profile_gate(title, ids) {+ return true;}}false}+/// Anchored `browser_title_patterns` fallback for the macOS AX sweep.+///+/// The Google Meet profile is gated on a Meet-code token in the title (see+/// `title_contains_meeting_code`): Chrome/Edge title the post-call page "Meet"+/// too, and the sweep is not mic-gated, so the bare anchor alone phantom-fired+/// on idle Meet pages. That gate is Meet-specific — other platforms' titles+/// (e.g. Slack's "Huddles - <workspace> - Slack") carry no code, so requiring+/// one would disable their fallback entirely. Profiles with no title patterns+/// are unaffected either way.+#[cfg(any(target_os = "macos", test))]+fn title_matches_with_profile_gate(title: &str, ids: &AppIdentifiers) -> bool {+ let is_meet_profile = ids+ .browser_url_patterns+ .iter()+ .any(|p| p.contains("meet.google.com"));+ if is_meet_profile && !title_contains_meeting_code(title) {+ return false;+ }+ let title_lower = title.to_lowercase();+ ids.browser_title_patterns+ .iter()+ .any(|p| browser_title_matches_pattern(&title_lower, p))+}+/// True when `title` contains a standalone Google-Meet-code-shaped token:/// lowercase `[a-z]{3}-[a-z]{4}-[a-z]{3}` bounded by non-alphanumeric,/// non-`-` characters (or the string ends). `-` is treated as extending thediff --git a/crates/screenpipe-engine/src/meeting_watcher/shared/profiles.rs b/crates/screenpipe-engine/src/meeting_watcher/shared/profiles.rsindex 4a5001cfa..6c8830d31 100644--- a/crates/screenpipe-engine/src/meeting_watcher/shared/profiles.rs+++ b/crates/screenpipe-engine/src/meeting_watcher/shared/profiles.rs@@ -252,7 +252,25 @@ pub fn load_detection_profiles() -> Vec<MeetingDetectionProfile> {ignore_window_titles: &[],requires_call_signal: false,},- // Slack Huddle (browser + desktop)+ // Browser Slack: the Huddles list shares the in-call title and /client/+ // URL. Use those only to find the browser, then require a huddle-specific+ // control. A generic "Leave" button can belong to another tab or dialog.+ MeetingDetectionProfile {+ app_identifiers: AppIdentifiers {+ macos_app_names: &[],+ windows_process_names: &[],+ browser_url_patterns: &["app.slack.com/huddle"],+ browser_title_patterns: &["Huddles"],+ },+ call_signals: vec![CallSignal::RoleWithName {+ role: "AXButton",+ name_contains: "leave huddle",+ }],+ min_signals_required: 1,+ ignore_window_titles: &[],+ requires_call_signal: true,+ },+ // Native Slack retains its start policy and service-level ignore aliases.MeetingDetectionProfile {app_identifiers: AppIdentifiers {macos_app_names: &["slack"],diff --git a/crates/screenpipe-engine/src/meeting_watcher/ui_scan/tests.rs b/crates/screenpipe-engine/src/meeting_watcher/ui_scan/tests.rsindex 70a9e4930..7302e65f0 100644--- a/crates/screenpipe-engine/src/meeting_watcher/ui_scan/tests.rs+++ b/crates/screenpipe-engine/src/meeting_watcher/ui_scan/tests.rs@@ -1085,6 +1085,82 @@ fn test_real_browser_meetings_still_detected() {));}+#[test]+fn test_arc_slack_huddle_titles_detected() {+ // #6989 — Slack huddles in Arc/Chrome keep the tab at+ // `app.slack.com/client/...` (never `/huddle`), so the URL pattern can't+ // fire. The huddle window title is the only signal, and the URL is on+ // Slack's own host, so the title fallback must apply.+ //+ // Huddles list / active huddle window title (captured from a live Arc+ // frame): "Huddles - leadgen - Slack".+ assert!(any_profile_matches(+ Some("https://app.slack.com/client/T0123456/C0123456"),+ Some("Huddles - leadgen - Slack")+ ));+ // URL-less window (Arc exposes no AXDocument) — plain fallback path.+ assert!(any_profile_matches(None, Some("Huddles - leadgen - Slack")));+ // Anchored prefix match: pattern "Huddles" + non-alphanumeric separator.+ assert!(any_profile_matches(+ Some("https://app.slack.com/client/T0123456/D0123456"),+ Some("Huddles — My Workspace - Slack")+ ));+}++#[test]+fn test_arc_slack_non_huddle_titles_not_detected() {+ // Ordinary Slack browsing must NOT start a meeting: the workspace URL is+ // on Slack's host but the titles carry no huddle marker.+ assert!(!any_profile_matches(+ Some("https://app.slack.com/client/T0BBNEEH6Q2/D0BBT87MELU"),+ Some("Alex N (DM) - 1651 Market Apartments Residents - 1 new item - Slack")+ ));+ assert!(!any_profile_matches(+ Some("https://app.slack.com/client/T0123456/C0123456"),+ Some("* Threads - leadgen - Slack")+ ));+ // #4246 guardrail unchanged: huddle-ish title on a FOREIGN host must not+ // match even though "Huddles" would anchor-match the title.+ assert!(!any_profile_matches(+ Some("https://www.amazon.com/dp/B0123456"),+ Some("Huddles - leadgen - Slack")+ ));+ // Substring anchoring: "Huddlesworth" must not match (next char is alnum).+ assert!(!any_profile_matches(+ Some("https://app.slack.com/client/T0123456/C0123456"),+ Some("Huddlesworth notes - Slack")+ ));+}++#[test]+fn slack_title_fallback_checks_the_parsed_host() {+ for url in [+ "https://example.org/app.slack.com/client/T123/C456",+ "https://[email protected]/client/T123/C456",+ "https://app.slack.com.example.org/client/T123/C456",+ "https://notapp.slack.com/client/T123/C456",+ "https://example.org/?next=https://app.slack.com/client/T123/C456",+ "https://example.org/#app.slack.com/client/T123/C456",+ "file:///app.slack.com/client/T123/C456",+ "not a URL app.slack.com/client/T123/C456",+ ] {+ assert!(+ !any_profile_matches(Some(url), Some("Huddles - workspace - Slack")),+ "foreign or invalid URL must not enable the title fallback: {url}"+ );+ }+ for url in [+ "https://app.slack.com/client/T123/C456",+ "https://APP.SLACK.COM:443/client/T123/C456?view=huddles#top",+ "https://sub.app.slack.com/client/T123/C456",+ ] {+ assert!(any_profile_matches(+ Some(url),+ Some("Huddles - workspace - Slack")+ ));+ }+}+// ── State machine tests ────────────────────────────────────────────fn make_scan_result(app: &str, in_call: bool, signals: usize) -> ScanResult {diff --git a/crates/screenpipe-engine/tests/fixtures/slack-missing-browser-diagnostic.txt b/crates/screenpipe-engine/tests/fixtures/slack-missing-browser-diagnostic.txtnew file mode 100644index 000000000..152c948e2--- /dev/null+++ b/crates/screenpipe-engine/tests/fixtures/slack-missing-browser-diagnostic.txt@@ -0,0 +1 @@+ WARN screenpipe_engine::meeting_watcher::audio_process::resolve: meeting call-control scan could not resolve the browser UI process; meeting start withheld platform=Slack Huddle audio_pid=84