Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions desktop/src-tauri/src/commands/agent_auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ fn run_buzz_acp_auth_command_with_paths<const N: usize>(
if let Some(path) = augmented_path {
command.env("PATH", path);
}
#[cfg(windows)]
{
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
command.creation_flags(CREATE_NO_WINDOW);
}

command
.output()
Expand Down Expand Up @@ -226,11 +232,19 @@ fn run_claude_subscription_login(runtime_id: &str, method: &AcpAuthMethod) -> Re
let (command, args) = argv
.split_first()
.ok_or_else(|| "Claude login command is empty".to_string())?;
let status = Command::new(command)
let mut login = Command::new(command);
login
.args(args)
.stdin(Stdio::null())
.stdout(Stdio::null())
.stderr(Stdio::null())
.stderr(Stdio::null());
#[cfg(windows)]
{
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
login.creation_flags(CREATE_NO_WINDOW);
}
let status = login
.status()
.map_err(|error| format!("failed to run Claude login: {error}"))?;
if !status.success() {
Expand Down
13 changes: 10 additions & 3 deletions desktop/src-tauri/src/commands/agent_discovery/managed_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,19 @@ fn managed_node_runtime_ready() -> bool {
if !node.is_file() {
return false;
}
let output = std::process::Command::new(&node)
let mut command = std::process::Command::new(&node);
command
.arg("--version")
.stdin(std::process::Stdio::null())
.stdout(std::process::Stdio::piped())
.stderr(std::process::Stdio::null())
.output();
.stderr(std::process::Stdio::null());
#[cfg(windows)]
{
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
command.creation_flags(CREATE_NO_WINDOW);
}
let output = command.output();
output
.ok()
.filter(|output| output.status.success())
Expand Down
6 changes: 6 additions & 0 deletions desktop/src-tauri/src/commands/agent_model_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ pub(super) async fn run_agent_models_command(
cmd.env(k, v);
}
crate::managed_agents::configure_runtime_cli(&mut cmd, known_acp_runtime(&agent_command));
#[cfg(windows)]
{
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
cmd.creation_flags(CREATE_NO_WINDOW);
}
cmd.stdout(std::process::Stdio::piped())
.stderr(std::process::Stdio::piped())
.output()
Expand Down
33 changes: 26 additions & 7 deletions desktop/src-tauri/src/commands/media_transcode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ fn ffmpeg_command(path: &std::path::Path) -> std::process::Command {
for (name, value) in required_windows_env {
command.env(name, value);
}
#[cfg(windows)]
{
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
command.creation_flags(CREATE_NO_WINDOW);
}
command
}

Expand Down Expand Up @@ -576,7 +582,8 @@ mod tests {
};
let source =
std::env::temp_dir().join(format!("buzz-metadata-test-{}.mp4", uuid::Uuid::new_v4()));
let generated = std::process::Command::new(&ffmpeg)
let mut generate = std::process::Command::new(&ffmpeg);
generate
.args(["-y", "-loglevel", "error", "-f", "lavfi", "-i"])
.arg("testsrc2=size=64x64:rate=1")
.args([
Expand All @@ -589,9 +596,14 @@ mod tests {
"-metadata:s:v:0",
"title=private camera stream",
])
.arg(&source)
.output()
.expect("run ffmpeg fixture generation");
.arg(&source);
#[cfg(windows)]
{
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
generate.creation_flags(CREATE_NO_WINDOW);
}
let generated = generate.output().expect("run ffmpeg fixture generation");
if !generated.status.success() {
eprintln!("skipping metadata round-trip: ffmpeg cannot encode H.264");
let _ = std::fs::remove_file(&source);
Expand Down Expand Up @@ -623,12 +635,19 @@ mod tests {
// Generate a small HEIC test image from a synthetic color source.
let heic_path =
std::env::temp_dir().join(format!("buzz-test-{}.heic", uuid::Uuid::new_v4()));
let gen = std::process::Command::new(&ffmpeg)
let mut generate = std::process::Command::new(&ffmpeg);
generate
.args(["-y", "-loglevel", "error", "-f", "lavfi", "-i"])
.arg("color=c=red:s=64x64:d=1")
.args(["-frames:v", "1"])
.arg(&heic_path)
.output();
.arg(&heic_path);
#[cfg(windows)]
{
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
generate.creation_flags(CREATE_NO_WINDOW);
}
let gen = generate.output();

let gen = match gen {
Ok(o) if o.status.success() && heic_path.exists() => o,
Expand Down
6 changes: 6 additions & 0 deletions desktop/src-tauri/src/commands/project_git_exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ pub(crate) fn run_git(
command.stdin(Stdio::null());
command.stdout(Stdio::piped());
command.stderr(Stdio::piped());
#[cfg(windows)]
{
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
command.creation_flags(CREATE_NO_WINDOW);
}

let mut child = command
.spawn()
Expand Down
14 changes: 10 additions & 4 deletions desktop/src-tauri/src/commands/relay_reconnect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,18 @@ fn run_with_timeout(
argv: &[String],
timeout: std::time::Duration,
) -> Result<std::process::Output, String> {
let mut child = std::process::Command::new(&argv[0])
let mut command = std::process::Command::new(&argv[0]);
command
.args(&argv[1..])
.stdout(std::process::Stdio::piped())
.stderr(std::process::Stdio::null())
.spawn()
.map_err(|e| format!("spawn failed: {e}"))?;
.stderr(std::process::Stdio::null());
#[cfg(windows)]
{
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
command.creation_flags(CREATE_NO_WINDOW);
}
let mut child = command.spawn().map_err(|e| format!("spawn failed: {e}"))?;

let deadline = std::time::Instant::now() + timeout;
loop {
Expand Down
12 changes: 12 additions & 0 deletions desktop/src-tauri/src/managed_agents/agent_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ mod tests {
let mut cmd = std::process::Command::new("env");
cmd.env_clear();
build_buzz_agent_provider_defaults(&mut cmd);
#[cfg(windows)]
{
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
cmd.creation_flags(CREATE_NO_WINDOW);
}
let output = cmd.output().expect("env should run");
let stdout = String::from_utf8_lossy(&output.stdout);
assert!(
Expand Down Expand Up @@ -229,6 +235,12 @@ mod tests {
cmd.env("BUZZ_AGENT_PROVIDER", "databricks");
// Simulate what runtime_metadata_env_vars writes from the record (comes after).
cmd.env("BUZZ_AGENT_PROVIDER", "anthropic");
#[cfg(windows)]
{
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
cmd.creation_flags(CREATE_NO_WINDOW);
}
let output = cmd.output().expect("env should run");
let stdout = String::from_utf8_lossy(&output.stdout);
assert!(
Expand Down
12 changes: 9 additions & 3 deletions desktop/src-tauri/src/managed_agents/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,16 @@ pub fn invoke_provider(
if let Some(home) = super::default_agent_workdir() {
cmd.current_dir(home);
}
let mut child = cmd
.stdin(std::process::Stdio::piped())
cmd.stdin(std::process::Stdio::piped())
.stdout(std::process::Stdio::piped())
.stderr(std::process::Stdio::piped())
.stderr(std::process::Stdio::piped());
#[cfg(windows)]
{
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
cmd.creation_flags(CREATE_NO_WINDOW);
}
let mut child = cmd
.spawn()
.map_err(|e| format!("failed to spawn {}: {e}", binary.display()))?;

Expand Down
22 changes: 21 additions & 1 deletion desktop/src-tauri/src/managed_agents/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,15 @@ fn login_shell_candidates() -> Vec<PathBuf> {
/// Returns trimmed stdout if the command succeeds with non-empty output.
fn run_in_login_shell(args: &[&str]) -> Option<String> {
for shell in login_shell_candidates() {
let Ok(output) = Command::new(&shell).args(args).output() else {
let mut command = Command::new(&shell);
command.args(args);
#[cfg(windows)]
{
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
command.creation_flags(CREATE_NO_WINDOW);
}
let Ok(output) = command.output() else {
continue;
};
if !output.status.success() {
Expand Down Expand Up @@ -916,6 +924,12 @@ fn probe_auth_status(binary_path: &Path, probe_args: &[&str]) -> AuthStatus {
.stdin(std::process::Stdio::null())
.stdout(std::process::Stdio::piped())
.stderr(std::process::Stdio::piped());
#[cfg(windows)]
{
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
command.creation_flags(CREATE_NO_WINDOW);
}

let mut child = match command.spawn() {
Ok(c) => c,
Expand Down Expand Up @@ -1079,6 +1093,12 @@ pub(crate) fn probe_codex_acp_major_version_with_path(
if let Some(path) = augmented_path {
command.env("PATH", path);
}
#[cfg(windows)]
{
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
command.creation_flags(CREATE_NO_WINDOW);
}
let mut child = command
.stdout(tmp.try_clone().ok()?)
.stderr(std::process::Stdio::null())
Expand Down