Skip to content

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

fix(windows): keep activity agent launches hidden

Louis Beaumont39b88b44c03c
diff --git a/crates/screenpipe-core/src/agents/acp/extensions.rs b/crates/screenpipe-core/src/agents/acp/extensions.rs
index 133655fc1..4eb9f855d 100644
--- a/crates/screenpipe-core/src/agents/acp/extensions.rs
+++ b/crates/screenpipe-core/src/agents/acp/extensions.rs
@@ -29,7 +29,7 @@ use serde::Deserialize;
use std::collections::HashSet;
use std::io::Read;
use std::path::{Component, Path, PathBuf};
-use std::process::{Child, Command, Stdio};
+use std::process::{Child, Stdio};
const MAX_MANIFEST_BYTES: u64 = 1024 * 1024;
const PORTABLE_MCP_ARG: &str = "--screenpipe-portable-mcp";
@@ -157,7 +157,7 @@ impl AcpExtensionMiddleware {
let Some(port) = free_port() else {
continue;
};
- let mut command = Command::new(bun_path);
+ let mut command = crate::no_window_command(bun_path);
command
.arg(&extension.entrypoint)
.current_dir(&extension.package_root)
@@ -246,7 +246,7 @@ pub fn run_portable_mcp_mode() -> Result<i32, String> {
return Err("portable MCP entrypoint escapes its installed package".into());
}
- let status = Command::new(bun_path)
+ let status = crate::no_window_command(bun_path)
.arg(entrypoint)
.current_dir(root)
.env_clear()
diff --git a/crates/screenpipe-core/src/agents/acp/runtime.rs b/crates/screenpipe-core/src/agents/acp/runtime.rs
index 871699a3e..a85739e85 100644
--- a/crates/screenpipe-core/src/agents/acp/runtime.rs
+++ b/crates/screenpipe-core/src/agents/acp/runtime.rs
@@ -2902,7 +2902,7 @@ fn wait_port_ready(port: u16, timeout: std::time::Duration) {
/// the runtime's process group, so desktop teardown kills them too). Best
/// effort: a server that can't spawn is simply omitted.
fn spawn_http_mcp_servers(config: &RuntimeConfig) -> Vec<std::process::Child> {
- use std::process::{Command, Stdio};
+ use std::process::Stdio;
let mut children = Vec::new();
let mut urls: Vec<(String, String)> = Vec::new();
let engine_url = engine_api_url();
@@ -2912,7 +2912,7 @@ fn spawn_http_mcp_servers(config: &RuntimeConfig) -> Vec<std::process::Child> {
// below so it is listening before session/new.
if let (Some(tools_path), Some(port)) = (ensure_tools_mcp_server(config), free_loopback_port())
{
- let mut cmd = Command::new(&config.bun_path);
+ let mut cmd = crate::no_window_command(&config.bun_path);
cmd.arg(&tools_path)
.env("SCREENPIPE_TOOLS_HTTP_PORT", port.to_string())
.stdin(Stdio::null())
@@ -2945,7 +2945,7 @@ fn spawn_http_mcp_servers(config: &RuntimeConfig) -> Vec<std::process::Child> {
// only that mode). Best-effort: `bun x` may fetch it on first run, so it can
// lag; we still advertise it (the agent retries) rather than block on it.
if let Some(port) = free_loopback_port() {
- let mut cmd = Command::new(&config.bun_path);
+ let mut cmd = crate::no_window_command(&config.bun_path);
cmd.arg("x")
.arg(SCREENPIPE_MCP_PKG)
.arg("--http")
diff --git a/crates/screenpipe-core/src/agents/cli_runtime.rs b/crates/screenpipe-core/src/agents/cli_runtime.rs
index aea625e5e..f32d78ff1 100644
--- a/crates/screenpipe-core/src/agents/cli_runtime.rs
+++ b/crates/screenpipe-core/src/agents/cli_runtime.rs
@@ -368,7 +368,7 @@ pub fn refresh_blocking(screenpipe_dir: &Path, bun: &Path) -> std::io::Result<Pa
b"{\"name\":\"sp-cli-resolve\"}\n",
)?;
- let spawn = std::process::Command::new(bun)
+ let spawn = crate::no_window_command(bun)
.arg("install")
.arg("screenpipe@latest")
.current_dir(&work)