Bump rust toolchain to 1.92 (current stable) (#6356)

This commit is contained in:
Jack Amadeo
2026-01-06 14:13:20 -05:00
committed by GitHub
parent 7be90cdacc
commit fb1d3dfd3d
27 changed files with 38 additions and 80 deletions

View File

@@ -1 +1 @@
.rustup-1.25.2.pkg
.rustup-1.28.2.pkg

View File

@@ -1 +1 @@
.rustup-1.25.2.pkg
.rustup-1.28.2.pkg

View File

@@ -1 +1 @@
.rustup-1.25.2.pkg
.rustup-1.28.2.pkg

View File

@@ -1 +1 @@
.rustup-1.25.2.pkg
.rustup-1.28.2.pkg

View File

@@ -1 +1 @@
.rustup-1.25.2.pkg
.rustup-1.28.2.pkg

View File

@@ -1 +1 @@
.rustup-1.25.2.pkg
.rustup-1.28.2.pkg

View File

@@ -1 +1 @@
.rustup-1.25.2.pkg
.rustup-1.28.2.pkg

View File

@@ -1 +1 @@
.rustup-1.25.2.pkg
.rustup-1.28.2.pkg

View File

@@ -1 +1 @@
.rustup-1.25.2.pkg
.rustup-1.28.2.pkg

View File

@@ -1 +1 @@
.rustup-1.25.2.pkg
.rustup-1.28.2.pkg

View File

@@ -1 +1 @@
.rustup-1.25.2.pkg
.rustup-1.28.2.pkg

View File

@@ -1 +1 @@
.rustup-1.25.2.pkg
.rustup-1.28.2.pkg

View File

@@ -1 +1 @@
.rustup-1.25.2.pkg
.rustup-1.28.2.pkg

View File

@@ -1 +1 @@
.rustup-1.25.2.pkg
.rustup-1.28.2.pkg

View File

@@ -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)
};

View File

@@ -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")]

View File

@@ -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 {

View File

@@ -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,
}

View File

@@ -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)
};

View File

@@ -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 {

View File

@@ -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.")

View File

@@ -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)
})
}

View File

@@ -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<Message> {
))
}
#[derive(Serialize, Deserialize, Debug)]
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")
@@ -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");

View File

@@ -439,7 +439,7 @@ impl Provider for GcpVertexAIProvider {
where
Self: Sized,
{
let model_strings: Vec<String> = vec![
let model_strings: Vec<String> = [
GcpVertexAIModel::Claude(ClaudeVersion::Sonnet37),
GcpVertexAIModel::Claude(ClaudeVersion::Sonnet4),
GcpVertexAIModel::Claude(ClaudeVersion::Opus4),

View File

@@ -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 {

View File

@@ -1,3 +1,3 @@
[toolchain]
channel = "1.88.0"
channel = "1.92"
profile = "default"