Skip to content
Merged
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
File renamed without changes.
2 changes: 1 addition & 1 deletion bin/cargo
2 changes: 1 addition & 1 deletion bin/cargo-clippy
2 changes: 1 addition & 1 deletion bin/cargo-fmt
2 changes: 1 addition & 1 deletion bin/cargo-miri
2 changes: 1 addition & 1 deletion bin/clippy-driver
2 changes: 1 addition & 1 deletion bin/rls
2 changes: 1 addition & 1 deletion bin/rust-analyzer
2 changes: 1 addition & 1 deletion bin/rust-gdb
2 changes: 1 addition & 1 deletion bin/rust-gdbgui
2 changes: 1 addition & 1 deletion bin/rust-lldb
2 changes: 1 addition & 1 deletion bin/rustc
2 changes: 1 addition & 1 deletion bin/rustdoc
2 changes: 1 addition & 1 deletion bin/rustfmt
2 changes: 1 addition & 1 deletion bin/rustup
4 changes: 2 additions & 2 deletions crates/goose-cli/src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
};
Expand Down
3 changes: 3 additions & 0 deletions crates/goose-mcp/src/computercontroller/platform/mod.rs
Original file line number Diff line number Diff line change
@@ -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")]
Expand Down
6 changes: 2 additions & 4 deletions crates/goose-mcp/src/developer/tests/test_diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions crates/goose-mcp/src/developer/text_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,16 +483,16 @@ 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}
{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,
}
Expand Down
4 changes: 2 additions & 2 deletions crates/goose-server/src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
};
Expand Down
6 changes: 3 additions & 3 deletions crates/goose/src/agents/extension_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion crates/goose/src/conversation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ mod tests {

#[test]
fn test_valid_conversation() {
let all_messages = vec![
let all_messages = [
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

Type mismatch: assigning an array directly to a Vec variable. The array should be followed by .to_vec() or the type annotation should be removed to allow type inference.

Copilot uses AI. Check for mistakes.
Message::user().with_text("Can you help me search for something?"),
Message::assistant()
.with_text("I'll help you search.")
Expand Down
3 changes: 1 addition & 2 deletions crates/goose/src/permission/permission_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,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()
.rfind(|record| record.expiry.is_none_or(|exp| exp > Utc::now().timestamp()))
.map(|record| record.allowed)
})
}
Expand Down
43 changes: 3 additions & 40 deletions crates/goose/src/providers/formats/databricks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -370,43 +370,6 @@ pub fn response_to_message(response: &Value) -> anyhow::Result<Message> {
))
}

#[derive(Serialize, Deserialize, Debug)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

were these just unused?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah seems so, and I'm not sure why it wasn't flagged by the build before, but I'm guessing some improvements were made between 1.88 and 1.92 to finding dead code

struct DeltaToolCallFunction {
name: Option<String>,
arguments: String, // chunk of encoded JSON,
}

#[derive(Serialize, Deserialize, Debug)]
struct DeltaToolCall {
id: Option<String>,
function: DeltaToolCallFunction,
index: Option<i32>,
r#type: Option<String>,
}

#[derive(Serialize, Deserialize, Debug)]
struct Delta {
content: Option<String>,
role: Option<String>,
tool_calls: Option<Vec<DeltaToolCall>>,
}

#[derive(Serialize, Deserialize, Debug)]
struct StreamingChoice {
delta: Delta,
index: Option<i32>,
finish_reason: Option<String>,
}

#[derive(Serialize, Deserialize, Debug)]
struct StreamingChunk {
choices: Vec<StreamingChoice>,
created: Option<i64>,
id: Option<String>,
usage: Option<Value>,
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")
Expand Down Expand Up @@ -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");

Expand Down
2 changes: 1 addition & 1 deletion crates/goose/src/providers/gcpvertexai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ impl Provider for GcpVertexAIProvider {
where
Self: Sized,
{
let model_strings: Vec<String> = vec![
let model_strings: Vec<String> = [
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

Type mismatch: assigning an array directly to a Vec variable. The array should be followed by .to_vec() or the type annotation should be removed to allow type inference.

Copilot uses AI. Check for mistakes.
GcpVertexAIModel::Claude(ClaudeVersion::Sonnet37),
GcpVertexAIModel::Claude(ClaudeVersion::Sonnet4),
GcpVertexAIModel::Claude(ClaudeVersion::Opus4),
Expand Down
9 changes: 2 additions & 7 deletions crates/goose/src/session/session_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,17 @@ 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,
Hidden,
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 {
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.88.0"
channel = "1.92"
profile = "default"
Loading