From 6586793910e6bbba48992779732a9cbb5b362882 Mon Sep 17 00:00:00 2001 From: Jack Amadeo Date: Tue, 6 Jan 2026 12:35:34 -0500 Subject: [PATCH 1/4] Bump rust toolchain to 1.92 (current stable) --- bin/.rustup-1.25.2.pkg | 1 - bin/cargo | 2 +- bin/cargo-clippy | 2 +- bin/cargo-fmt | 2 +- bin/cargo-miri | 2 +- bin/clippy-driver | 2 +- bin/rls | 2 +- bin/rust-analyzer | 2 +- bin/rust-gdb | 2 +- bin/rust-gdbgui | 2 +- bin/rust-lldb | 2 +- bin/rustc | 2 +- bin/rustdoc | 2 +- bin/rustfmt | 2 +- bin/rustup | 2 +- rust-toolchain.toml | 2 +- 16 files changed, 15 insertions(+), 16 deletions(-) delete mode 120000 bin/.rustup-1.25.2.pkg diff --git a/bin/.rustup-1.25.2.pkg b/bin/.rustup-1.25.2.pkg deleted file mode 120000 index 383f4511d444..000000000000 --- a/bin/.rustup-1.25.2.pkg +++ /dev/null @@ -1 +0,0 @@ -hermit \ No newline at end of file diff --git a/bin/cargo b/bin/cargo index 5046e66f8598..906ee94ca689 120000 --- a/bin/cargo +++ b/bin/cargo @@ -1 +1 @@ -.rustup-1.25.2.pkg \ No newline at end of file +.rustup-1.28.2.pkg \ No newline at end of file diff --git a/bin/cargo-clippy b/bin/cargo-clippy index 5046e66f8598..906ee94ca689 120000 --- a/bin/cargo-clippy +++ b/bin/cargo-clippy @@ -1 +1 @@ -.rustup-1.25.2.pkg \ No newline at end of file +.rustup-1.28.2.pkg \ No newline at end of file diff --git a/bin/cargo-fmt b/bin/cargo-fmt index 5046e66f8598..906ee94ca689 120000 --- a/bin/cargo-fmt +++ b/bin/cargo-fmt @@ -1 +1 @@ -.rustup-1.25.2.pkg \ No newline at end of file +.rustup-1.28.2.pkg \ No newline at end of file diff --git a/bin/cargo-miri b/bin/cargo-miri index 5046e66f8598..906ee94ca689 120000 --- a/bin/cargo-miri +++ b/bin/cargo-miri @@ -1 +1 @@ -.rustup-1.25.2.pkg \ No newline at end of file +.rustup-1.28.2.pkg \ No newline at end of file diff --git a/bin/clippy-driver b/bin/clippy-driver index 5046e66f8598..906ee94ca689 120000 --- a/bin/clippy-driver +++ b/bin/clippy-driver @@ -1 +1 @@ -.rustup-1.25.2.pkg \ No newline at end of file +.rustup-1.28.2.pkg \ No newline at end of file diff --git a/bin/rls b/bin/rls index 5046e66f8598..906ee94ca689 120000 --- a/bin/rls +++ b/bin/rls @@ -1 +1 @@ -.rustup-1.25.2.pkg \ No newline at end of file +.rustup-1.28.2.pkg \ No newline at end of file diff --git a/bin/rust-analyzer b/bin/rust-analyzer index 5046e66f8598..906ee94ca689 120000 --- a/bin/rust-analyzer +++ b/bin/rust-analyzer @@ -1 +1 @@ -.rustup-1.25.2.pkg \ No newline at end of file +.rustup-1.28.2.pkg \ No newline at end of file diff --git a/bin/rust-gdb b/bin/rust-gdb index 5046e66f8598..906ee94ca689 120000 --- a/bin/rust-gdb +++ b/bin/rust-gdb @@ -1 +1 @@ -.rustup-1.25.2.pkg \ No newline at end of file +.rustup-1.28.2.pkg \ No newline at end of file diff --git a/bin/rust-gdbgui b/bin/rust-gdbgui index 5046e66f8598..906ee94ca689 120000 --- a/bin/rust-gdbgui +++ b/bin/rust-gdbgui @@ -1 +1 @@ -.rustup-1.25.2.pkg \ No newline at end of file +.rustup-1.28.2.pkg \ No newline at end of file diff --git a/bin/rust-lldb b/bin/rust-lldb index 5046e66f8598..906ee94ca689 120000 --- a/bin/rust-lldb +++ b/bin/rust-lldb @@ -1 +1 @@ -.rustup-1.25.2.pkg \ No newline at end of file +.rustup-1.28.2.pkg \ No newline at end of file diff --git a/bin/rustc b/bin/rustc index 5046e66f8598..906ee94ca689 120000 --- a/bin/rustc +++ b/bin/rustc @@ -1 +1 @@ -.rustup-1.25.2.pkg \ No newline at end of file +.rustup-1.28.2.pkg \ No newline at end of file diff --git a/bin/rustdoc b/bin/rustdoc index 5046e66f8598..906ee94ca689 120000 --- a/bin/rustdoc +++ b/bin/rustdoc @@ -1 +1 @@ -.rustup-1.25.2.pkg \ No newline at end of file +.rustup-1.28.2.pkg \ No newline at end of file diff --git a/bin/rustfmt b/bin/rustfmt index 5046e66f8598..906ee94ca689 120000 --- a/bin/rustfmt +++ b/bin/rustfmt @@ -1 +1 @@ -.rustup-1.25.2.pkg \ No newline at end of file +.rustup-1.28.2.pkg \ No newline at end of file diff --git a/bin/rustup b/bin/rustup index 5046e66f8598..906ee94ca689 120000 --- a/bin/rustup +++ b/bin/rustup @@ -1 +1 @@ -.rustup-1.25.2.pkg \ No newline at end of file +.rustup-1.28.2.pkg \ No newline at end of file diff --git a/rust-toolchain.toml b/rust-toolchain.toml index ab40f4f44594..532fcab5b284 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.88.0" +channel = "1.92" profile = "default" From 8a34d00a37961ff28136407b8279463a4caae251 Mon Sep 17 00:00:00 2001 From: Jack Amadeo Date: Tue, 6 Jan 2026 12:54:17 -0500 Subject: [PATCH 2/4] Add missing hermit package file --- bin/.rustup-1.28.2.pkg | 1 + 1 file changed, 1 insertion(+) create mode 120000 bin/.rustup-1.28.2.pkg diff --git a/bin/.rustup-1.28.2.pkg b/bin/.rustup-1.28.2.pkg new file mode 120000 index 000000000000..383f4511d444 --- /dev/null +++ b/bin/.rustup-1.28.2.pkg @@ -0,0 +1 @@ +hermit \ No newline at end of file From 35d442c62567cc58ebf40c4491ed05e95e190b11 Mon Sep 17 00:00:00 2001 From: Jack Amadeo Date: Tue, 6 Jan 2026 13:31:31 -0500 Subject: [PATCH 3/4] Fix new lint errors --- crates/goose-cli/src/logging.rs | 4 +- .../src/computercontroller/platform/mod.rs | 3 ++ .../src/developer/tests/test_diff.rs | 6 +-- crates/goose-mcp/src/developer/text_editor.rs | 6 +-- crates/goose-server/src/logging.rs | 4 +- crates/goose/src/agents/extension_manager.rs | 6 +-- crates/goose/src/conversation/mod.rs | 2 +- .../goose/src/permission/permission_store.rs | 4 +- .../goose/src/providers/formats/databricks.rs | 43 ++----------------- crates/goose/src/providers/gcpvertexai.rs | 2 +- crates/goose/src/session/session_manager.rs | 9 +--- 11 files changed, 23 insertions(+), 66 deletions(-) diff --git a/crates/goose-cli/src/logging.rs b/crates/goose-cli/src/logging.rs index acd9d16d23ee..e98d3658c13f 100644 --- a/crates/goose-cli/src/logging.rs +++ b/crates/goose-cli/src/logging.rs @@ -45,8 +45,8 @@ fn setup_logging_internal( result = (|| { let log_dir = goose::logging::prepare_log_directory("cli", true)?; let timestamp = chrono::Local::now().format("%Y%m%d_%H%M%S").to_string(); - let log_filename = if name.is_some() { - format!("{}-{}.log", timestamp, name.unwrap()) + let log_filename = if let Some(n) = name { + format!("{}-{}.log", timestamp, n) } else { format!("{}.log", timestamp) }; diff --git a/crates/goose-mcp/src/computercontroller/platform/mod.rs b/crates/goose-mcp/src/computercontroller/platform/mod.rs index a57b5df54294..5a456ca8962b 100644 --- a/crates/goose-mcp/src/computercontroller/platform/mod.rs +++ b/crates/goose-mcp/src/computercontroller/platform/mod.rs @@ -1,5 +1,8 @@ +#[cfg(target_os = "linux")] mod linux; +#[cfg(target_os = "macos")] mod macos; +#[cfg(target_os = "windows")] mod windows; #[cfg(target_os = "windows")] diff --git a/crates/goose-mcp/src/developer/tests/test_diff.rs b/crates/goose-mcp/src/developer/tests/test_diff.rs index 457bc4b33077..08137f95f670 100644 --- a/crates/goose-mcp/src/developer/tests/test_diff.rs +++ b/crates/goose-mcp/src/developer/tests/test_diff.rs @@ -184,9 +184,8 @@ new file mode 100644 // mpatch may add a trailing newline let content = std::fs::read_to_string(&file_path).unwrap(); assert!(content == "different\ncontent" || content == "different\ncontent\n"); - } else { + } else if let Err(err) = result { // Or it might return an error - let err = result.unwrap_err(); assert!( err.message.contains("diff") || err.message.contains("version") @@ -213,8 +212,7 @@ new file mode 100644 // The behavior might be different with patcher - it might create the file // or it might fail. Let's check what happens. - if result.is_err() { - let err = result.unwrap_err(); + if let Err(err) = result { // Could be "Failed to read" or similar assert!(err.message.contains("Failed") || err.message.contains("exist")); } else { diff --git a/crates/goose-mcp/src/developer/text_editor.rs b/crates/goose-mcp/src/developer/text_editor.rs index d7f0bdb4a434..120fae0d3f86 100644 --- a/crates/goose-mcp/src/developer/text_editor.rs +++ b/crates/goose-mcp/src/developer/text_editor.rs @@ -483,7 +483,7 @@ pub fn format_file_content( }; let language = lang::get_language_identifier(path); - if view_range.is_some() { + if let Some((start, end)) = view_range { formatdoc! {" ### {path} (lines {start}-{end}) ```{language} @@ -491,8 +491,8 @@ pub fn format_file_content( ``` ", path=path.display(), - start=view_range.unwrap().0, - end=if view_range.unwrap().1 == -1 { "end".to_string() } else { view_range.unwrap().1.to_string() }, + start=start, + end=if end == -1 { "end".to_string() } else { end.to_string() }, language=language, content=display_content, } diff --git a/crates/goose-server/src/logging.rs b/crates/goose-server/src/logging.rs index 72c2b50d84b8..75e7c0bbaa27 100644 --- a/crates/goose-server/src/logging.rs +++ b/crates/goose-server/src/logging.rs @@ -15,8 +15,8 @@ use goose::tracing::{langfuse_layer, otlp_layer}; pub fn setup_logging(name: Option<&str>) -> Result<()> { let log_dir = goose::logging::prepare_log_directory("server", true)?; let timestamp = chrono::Local::now().format("%Y%m%d_%H%M%S").to_string(); - let log_filename = if name.is_some() { - format!("{}-{}.log", timestamp, name.unwrap()) + let log_filename = if let Some(n) = name { + format!("{}-{}.log", timestamp, n) } else { format!("{}.log", timestamp) }; diff --git a/crates/goose/src/agents/extension_manager.rs b/crates/goose/src/agents/extension_manager.rs index 206b873c89cb..6e0029f2f4aa 100644 --- a/crates/goose/src/agents/extension_manager.rs +++ b/crates/goose/src/agents/extension_manager.rs @@ -782,9 +782,9 @@ impl ExtensionManager { let extension_name = params.get("extension_name").and_then(|v| v.as_str()); // If extension name is provided, we can just look it up - if extension_name.is_some() { + if let Some(ext_name) = extension_name { let read_result = self - .read_resource(uri, extension_name.unwrap(), cancellation_token.clone()) + .read_resource(uri, ext_name, cancellation_token.clone()) .await?; let mut result = Vec::new(); @@ -1288,7 +1288,7 @@ mod tests { use rmcp::model::ListToolsResult; use rmcp::model::ReadResourceResult; use rmcp::model::ServerNotification; - use serde_json::json; + use tokio::sync::mpsc; impl ExtensionManager { diff --git a/crates/goose/src/conversation/mod.rs b/crates/goose/src/conversation/mod.rs index 524fbce39d75..5f86c660aede 100644 --- a/crates/goose/src/conversation/mod.rs +++ b/crates/goose/src/conversation/mod.rs @@ -544,7 +544,7 @@ mod tests { #[test] fn test_valid_conversation() { - let all_messages = vec![ + let all_messages = [ Message::user().with_text("Can you help me search for something?"), Message::assistant() .with_text("I'll help you search.") diff --git a/crates/goose/src/permission/permission_store.rs b/crates/goose/src/permission/permission_store.rs index fded07081c3f..746d08bc3316 100644 --- a/crates/goose/src/permission/permission_store.rs +++ b/crates/goose/src/permission/permission_store.rs @@ -83,9 +83,7 @@ impl ToolPermissionStore { self.permissions.get(&key).and_then(|records| { records - .iter() - .filter(|record| record.expiry.is_none_or(|exp| exp > Utc::now().timestamp())) - .next_back() + .iter().rfind(|record| record.expiry.is_none_or(|exp| exp > Utc::now().timestamp())) .map(|record| record.allowed) }) } diff --git a/crates/goose/src/providers/formats/databricks.rs b/crates/goose/src/providers/formats/databricks.rs index 3165b6de1e13..fc196e50d0a7 100644 --- a/crates/goose/src/providers/formats/databricks.rs +++ b/crates/goose/src/providers/formats/databricks.rs @@ -10,7 +10,7 @@ use rmcp::model::{ object, AnnotateAble, CallToolRequestParam, Content, ErrorCode, ErrorData, RawContent, ResourceContents, Role, Tool, }; -use serde::{Deserialize, Serialize}; +use serde::Serialize; use serde_json::{json, Value}; use std::borrow::Cow; @@ -370,43 +370,6 @@ pub fn response_to_message(response: &Value) -> anyhow::Result { )) } -#[derive(Serialize, Deserialize, Debug)] -struct DeltaToolCallFunction { - name: Option, - arguments: String, // chunk of encoded JSON, -} - -#[derive(Serialize, Deserialize, Debug)] -struct DeltaToolCall { - id: Option, - function: DeltaToolCallFunction, - index: Option, - r#type: Option, -} - -#[derive(Serialize, Deserialize, Debug)] -struct Delta { - content: Option, - role: Option, - tool_calls: Option>, -} - -#[derive(Serialize, Deserialize, Debug)] -struct StreamingChoice { - delta: Delta, - index: Option, - finish_reason: Option, -} - -#[derive(Serialize, Deserialize, Debug)] -struct StreamingChunk { - choices: Vec, - created: Option, - id: Option, - usage: Option, - model: String, -} - /// Check if the model name indicates a Claude/Anthropic model that supports cache control. fn is_claude_model(model_name: &str) -> bool { model_name.contains("claude") @@ -740,13 +703,13 @@ mod tests { }), ); - let spec = format_tools(&[tool.clone()], "gpt-4o")?; + let spec = format_tools(std::slice::from_ref(&tool), "gpt-4o")?; assert_eq!( spec[0]["function"]["parameters"]["$schema"], "http://json-schema.org/draft-07/schema#" ); - let spec = format_tools(&[tool.clone()], "gemini-2-5-flash")?; + let spec = format_tools(std::slice::from_ref(&tool), "gemini-2-5-flash")?; assert!(spec[0]["function"]["parameters"].get("$schema").is_none()); assert_eq!(spec[0]["function"]["parameters"]["type"], "object"); diff --git a/crates/goose/src/providers/gcpvertexai.rs b/crates/goose/src/providers/gcpvertexai.rs index bc441b08466d..ef32442f7fee 100644 --- a/crates/goose/src/providers/gcpvertexai.rs +++ b/crates/goose/src/providers/gcpvertexai.rs @@ -439,7 +439,7 @@ impl Provider for GcpVertexAIProvider { where Self: Sized, { - let model_strings: Vec = vec![ + let model_strings: Vec = [ GcpVertexAIModel::Claude(ClaudeVersion::Sonnet37), GcpVertexAIModel::Claude(ClaudeVersion::Sonnet4), GcpVertexAIModel::Claude(ClaudeVersion::Opus4), diff --git a/crates/goose/src/session/session_manager.rs b/crates/goose/src/session/session_manager.rs index 8a4641786bf6..ecfbe7692ff2 100644 --- a/crates/goose/src/session/session_manager.rs +++ b/crates/goose/src/session/session_manager.rs @@ -23,9 +23,10 @@ pub const CURRENT_SCHEMA_VERSION: i32 = 6; pub const SESSIONS_FOLDER: &str = "sessions"; pub const DB_NAME: &str = "sessions.db"; -#[derive(Debug, Clone, Copy, Serialize, Deserialize, ToSchema, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, Serialize, Deserialize, ToSchema, PartialEq, Eq, Default)] #[serde(rename_all = "snake_case")] pub enum SessionType { + #[default] User, Scheduled, SubAgent, @@ -33,12 +34,6 @@ pub enum SessionType { Terminal, } -impl Default for SessionType { - fn default() -> Self { - Self::User - } -} - impl std::fmt::Display for SessionType { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { From 63c637e304707657b9b614dfd41533234da68f98 Mon Sep 17 00:00:00 2001 From: Jack Amadeo Date: Tue, 6 Jan 2026 13:35:58 -0500 Subject: [PATCH 4/4] Format --- crates/goose/src/agents/extension_manager.rs | 2 +- crates/goose/src/permission/permission_store.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/goose/src/agents/extension_manager.rs b/crates/goose/src/agents/extension_manager.rs index 6e0029f2f4aa..78a22c7c2f38 100644 --- a/crates/goose/src/agents/extension_manager.rs +++ b/crates/goose/src/agents/extension_manager.rs @@ -1288,7 +1288,7 @@ mod tests { use rmcp::model::ListToolsResult; use rmcp::model::ReadResourceResult; use rmcp::model::ServerNotification; - + use tokio::sync::mpsc; impl ExtensionManager { diff --git a/crates/goose/src/permission/permission_store.rs b/crates/goose/src/permission/permission_store.rs index 746d08bc3316..17ff747d290d 100644 --- a/crates/goose/src/permission/permission_store.rs +++ b/crates/goose/src/permission/permission_store.rs @@ -83,7 +83,8 @@ impl ToolPermissionStore { self.permissions.get(&key).and_then(|records| { records - .iter().rfind(|record| record.expiry.is_none_or(|exp| exp > Utc::now().timestamp())) + .iter() + .rfind(|record| record.expiry.is_none_or(|exp| exp > Utc::now().timestamp())) .map(|record| record.allowed) }) }