Skip to content
Closed
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
2 changes: 0 additions & 2 deletions crates/goose-mcp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ mod memory;
pub mod peekaboo;
pub mod subprocess;
pub mod tutorial;
#[cfg(windows)]
pub mod windows_job;

pub use autovisualiser::AutoVisualiserRouter;
pub use computercontroller::ComputerControllerServer;
Expand Down
2 changes: 1 addition & 1 deletion crates/goose-mcp/src/subprocess.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn resolve_login_shell_path() -> Option<String> {
.stdout(Stdio::piped())
.stderr(Stdio::null());

// Spawn in a new session so that interactive shells job-control setup
// Spawn in a new session so that interactive shell job-control setup
// cannot steal the terminal foreground from the parent goose process.
cmd.wrap(ProcessSession);

Expand Down
22 changes: 0 additions & 22 deletions crates/goose-mcp/src/windows_job.rs

This file was deleted.

2 changes: 1 addition & 1 deletion crates/goose/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ subtle = { version = "2.5", default-features = false, features = ["std"] }
gethostname = "1.1.0"

[target.'cfg(target_os = "windows")'.dependencies]
winapi = { version = "0.3.9", default-features = false, features = ["wincred", "std", "jobapi2", "winbase", "winnt", "processthreadsapi", "handleapi", "minwindef"] }
winapi = { workspace = true }
keyring = { workspace = true, features = ["windows-native"], optional = true }

# Platform-specific GPU acceleration for Whisper and local inference
Expand Down
9 changes: 0 additions & 9 deletions crates/goose/src/agents/extension_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,15 +353,6 @@ async fn child_process_client(
let (transport, mut stderr) = TokioChildProcess::builder(command)
.stderr(Stdio::piped())
.spawn()?;
Comment on lines 353 to 355

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore Windows job cleanup for MCP children

When running on Windows, this spawn path is now the place creating stdio MCP extension processes, but the Windows Job Object attach was removed immediately after .spawn(). If goosed/desktop exits unexpectedly or is terminated before the async transport Drop/graceful shutdown runs, Windows leaves child processes and their descendants alive, so npx/uvx MCP servers can persist after Goose is closed. Please keep the job-object attach, or an equivalent Windows process-tree cleanup, around this spawn.

Useful? React with 👍 / 👎.

// Attach the child to a Windows Job Object to ensure proper cleanup on Goose exit
#[cfg(windows)]
{
if let Some(pid) = transport.id() {
// Initialize Job Object and attach the child process to it
crate::windows_job::init_windows_cleanup();
crate::windows_job::attach_pid_to_job(pid);
}
}
let mut stderr = stderr.take().ok_or_else(|| {
ExtensionError::SetupError("failed to attach child process stderr".to_owned())
})?;
Expand Down
3 changes: 0 additions & 3 deletions crates/goose/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,8 @@ pub mod slash_commands;
pub mod source_roots;
pub mod sources;
pub mod subprocess;

pub mod token_counter;
pub mod tool_inspection;
pub mod tool_monitor;
pub mod tracing;
pub mod utils;
#[cfg(windows)]
pub mod windows_job;
102 changes: 0 additions & 102 deletions crates/goose/src/windows_job.rs

This file was deleted.

Loading