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
Revert "fix(app): start in background on login autostart (#5195)" (#5207)
Ezra Ellettea48fe88191ec
diff --git a/apps/screenpipe-app-tauri/components/settings/general-settings.tsx b/apps/screenpipe-app-tauri/components/settings/general-settings.tsxindex bddea8a38..801db1d9a 100644--- a/apps/screenpipe-app-tauri/components/settings/general-settings.tsx+++ b/apps/screenpipe-app-tauri/components/settings/general-settings.tsx@@ -160,7 +160,7 @@ export default function GeneralSettings() {toast({title: checked ? "auto-start enabled" : "auto-start disabled",description: checked- ? "screenpipe will start in the background when you log in"+ ? "screenpipe will launch when your computer starts": "screenpipe won't launch at startup",});} catch (e: any) {@@ -231,7 +231,7 @@ export default function GeneralSettings() {<Rocket className="h-4 w-4 text-muted-foreground shrink-0" /><div><h3 className="text-sm font-medium text-foreground">Auto-start</h3>- <p className="text-xs text-muted-foreground">Start in the background when you log in</p>+ <p className="text-xs text-muted-foreground">Launch when your computer starts</p></div></div><Switchdiff --git a/apps/screenpipe-app-tauri/src-tauri/src/main.rs b/apps/screenpipe-app-tauri/src-tauri/src/main.rsindex bf355365d..12ef42e51 100644--- a/apps/screenpipe-app-tauri/src-tauri/src/main.rs+++ b/apps/screenpipe-app-tauri/src-tauri/src/main.rs@@ -17,7 +17,6 @@ use std::sync::atomic::{AtomicBool, AtomicU64, Ordering};use std::sync::Arc;use tauri::Emitter;use tauri::Manager;-#[cfg(target_os = "macos")]use tauri_plugin_autostart::MacosLauncher;use tauri_plugin_autostart::ManagerExt as AutostartManagerExt;#[allow(unused_imports)]@@ -219,24 +218,6 @@ fn should_skip_onboarding() -> bool {.unwrap_or(false)}-/// Flag passed by tauri-plugin-autostart when the OS launches us at login.-/// Used to skip Home so login starts stay in the tray.-const AUTOSTART_ARG: &str = "--autostart";--/// True when this process was started by the OS login/autostart entry-/// (LaunchAgent / Run registry), not a manual user launch.-fn launched_from_autostart() -> bool {- args_contain_autostart(std::env::args())-}--fn args_contain_autostart<I, S>(args: I) -> bool-where- I: IntoIterator<Item = S>,- S: AsRef<str>,-{- args.into_iter().any(|a| a.as_ref() == AUTOSTART_ARG)-}-// check if the server is running#[tauri::command]#[specta::specta]@@ -796,14 +777,10 @@ async fn main() {.plugin(tauri_plugin_fs::init()).plugin(tauri_plugin_permission_flow::init()).plugin(tauri_plugin_process::init())- .plugin({- // LaunchAgent on macOS so ProgramArguments can include --autostart- // (SMAppService MainApp cannot pass custom args).- let builder = tauri_plugin_autostart::Builder::new().args([AUTOSTART_ARG]);- #[cfg(target_os = "macos")]- let builder = builder.macos_launcher(MacosLauncher::LaunchAgent);- builder.build()- })+ .plugin(tauri_plugin_autostart::init(+ MacosLauncher::LaunchAgent,+ None,+ ))// single-instance plugin uses zbus::blocking on Linux which panics// inside an existing tokio runtime (nested block_on), so skip it on Linux;@@ -1309,20 +1286,13 @@ async fn main() {}let app_ui_hidden = crate::enterprise_policy::is_app_ui_hidden();- let from_autostart = launched_from_autostart();- if from_autostart {- info!("launched from OS autostart (--autostart); starting in background");- }- // Show onboarding/home unless managed background agent, or login- // autostart (tray + server only; UI via tray/dock/shortcut).- // Incomplete onboarding still shows so setup can finish.+ // Show onboarding/home unless this device is deployed as a managed+ // background agent. Permission recovery is handled separately below.if app_ui_hidden {info!("enterprise: hidden UI mode active, skipping startup app windows");} else if !onboarding_store.is_completed {let _ = ShowRewindWindow::Onboarding.show(&app.handle());- } else if from_autostart {- info!("autostart: skipping Home window (background login launch)");} else {let _ = ShowRewindWindow::Home { page: None }.show(&app.handle());}@@ -2100,24 +2070,6 @@ async fn main() {});}-#[cfg(test)]-mod autostart_arg_tests {- use super::{args_contain_autostart, AUTOSTART_ARG};-- #[test]- fn detects_autostart_flag() {- assert!(args_contain_autostart(["screenpipe", AUTOSTART_ARG]));- assert!(args_contain_autostart([AUTOSTART_ARG]));- }-- #[test]- fn ignores_unrelated_args() {- assert!(!args_contain_autostart(["screenpipe"]));- assert!(!args_contain_autostart(["screenpipe", "--check-arc-automation"]));- assert!(!args_contain_autostart(["screenpipe", "--autostarted"]));- }-}-#[cfg(all(test, target_os = "macos"))]mod mic_focus_recovery_tests {use super::MicFocusRecoveryTracker;