Bump rust toolchain to 1.92 (current stable) (#6356)
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
|||||||
.rustup-1.25.2.pkg
|
.rustup-1.28.2.pkg
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
.rustup-1.25.2.pkg
|
.rustup-1.28.2.pkg
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
.rustup-1.25.2.pkg
|
.rustup-1.28.2.pkg
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
.rustup-1.25.2.pkg
|
.rustup-1.28.2.pkg
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
.rustup-1.25.2.pkg
|
.rustup-1.28.2.pkg
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
.rustup-1.25.2.pkg
|
.rustup-1.28.2.pkg
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
.rustup-1.25.2.pkg
|
.rustup-1.28.2.pkg
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
.rustup-1.25.2.pkg
|
.rustup-1.28.2.pkg
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
.rustup-1.25.2.pkg
|
.rustup-1.28.2.pkg
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
.rustup-1.25.2.pkg
|
.rustup-1.28.2.pkg
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
.rustup-1.25.2.pkg
|
.rustup-1.28.2.pkg
|
||||||
@@ -45,8 +45,8 @@ fn setup_logging_internal(
|
|||||||
result = (|| {
|
result = (|| {
|
||||||
let log_dir = goose::logging::prepare_log_directory("cli", true)?;
|
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 timestamp = chrono::Local::now().format("%Y%m%d_%H%M%S").to_string();
|
||||||
let log_filename = if name.is_some() {
|
let log_filename = if let Some(n) = name {
|
||||||
format!("{}-{}.log", timestamp, name.unwrap())
|
format!("{}-{}.log", timestamp, n)
|
||||||
} else {
|
} else {
|
||||||
format!("{}.log", timestamp)
|
format!("{}.log", timestamp)
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
|
#[cfg(target_os = "linux")]
|
||||||
mod linux;
|
mod linux;
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
mod macos;
|
mod macos;
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
mod windows;
|
mod windows;
|
||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
|
|||||||
@@ -184,9 +184,8 @@ new file mode 100644
|
|||||||
// mpatch may add a trailing newline
|
// mpatch may add a trailing newline
|
||||||
let content = std::fs::read_to_string(&file_path).unwrap();
|
let content = std::fs::read_to_string(&file_path).unwrap();
|
||||||
assert!(content == "different\ncontent" || content == "different\ncontent\n");
|
assert!(content == "different\ncontent" || content == "different\ncontent\n");
|
||||||
} else {
|
} else if let Err(err) = result {
|
||||||
// Or it might return an error
|
// Or it might return an error
|
||||||
let err = result.unwrap_err();
|
|
||||||
assert!(
|
assert!(
|
||||||
err.message.contains("diff")
|
err.message.contains("diff")
|
||||||
|| err.message.contains("version")
|
|| err.message.contains("version")
|
||||||
@@ -213,8 +212,7 @@ new file mode 100644
|
|||||||
|
|
||||||
// The behavior might be different with patcher - it might create the file
|
// The behavior might be different with patcher - it might create the file
|
||||||
// or it might fail. Let's check what happens.
|
// or it might fail. Let's check what happens.
|
||||||
if result.is_err() {
|
if let Err(err) = result {
|
||||||
let err = result.unwrap_err();
|
|
||||||
// Could be "Failed to read" or similar
|
// Could be "Failed to read" or similar
|
||||||
assert!(err.message.contains("Failed") || err.message.contains("exist"));
|
assert!(err.message.contains("Failed") || err.message.contains("exist"));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -483,7 +483,7 @@ pub fn format_file_content(
|
|||||||
};
|
};
|
||||||
|
|
||||||
let language = lang::get_language_identifier(path);
|
let language = lang::get_language_identifier(path);
|
||||||
if view_range.is_some() {
|
if let Some((start, end)) = view_range {
|
||||||
formatdoc! {"
|
formatdoc! {"
|
||||||
### {path} (lines {start}-{end})
|
### {path} (lines {start}-{end})
|
||||||
```{language}
|
```{language}
|
||||||
@@ -491,8 +491,8 @@ pub fn format_file_content(
|
|||||||
```
|
```
|
||||||
",
|
",
|
||||||
path=path.display(),
|
path=path.display(),
|
||||||
start=view_range.unwrap().0,
|
start=start,
|
||||||
end=if view_range.unwrap().1 == -1 { "end".to_string() } else { view_range.unwrap().1.to_string() },
|
end=if end == -1 { "end".to_string() } else { end.to_string() },
|
||||||
language=language,
|
language=language,
|
||||||
content=display_content,
|
content=display_content,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ use goose::tracing::{langfuse_layer, otlp_layer};
|
|||||||
pub fn setup_logging(name: Option<&str>) -> Result<()> {
|
pub fn setup_logging(name: Option<&str>) -> Result<()> {
|
||||||
let log_dir = goose::logging::prepare_log_directory("server", true)?;
|
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 timestamp = chrono::Local::now().format("%Y%m%d_%H%M%S").to_string();
|
||||||
let log_filename = if name.is_some() {
|
let log_filename = if let Some(n) = name {
|
||||||
format!("{}-{}.log", timestamp, name.unwrap())
|
format!("{}-{}.log", timestamp, n)
|
||||||
} else {
|
} else {
|
||||||
format!("{}.log", timestamp)
|
format!("{}.log", timestamp)
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -782,9 +782,9 @@ impl ExtensionManager {
|
|||||||
let extension_name = params.get("extension_name").and_then(|v| v.as_str());
|
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 provided, we can just look it up
|
||||||
if extension_name.is_some() {
|
if let Some(ext_name) = extension_name {
|
||||||
let read_result = self
|
let read_result = self
|
||||||
.read_resource(uri, extension_name.unwrap(), cancellation_token.clone())
|
.read_resource(uri, ext_name, cancellation_token.clone())
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
let mut result = Vec::new();
|
let mut result = Vec::new();
|
||||||
@@ -1288,7 +1288,7 @@ mod tests {
|
|||||||
use rmcp::model::ListToolsResult;
|
use rmcp::model::ListToolsResult;
|
||||||
use rmcp::model::ReadResourceResult;
|
use rmcp::model::ReadResourceResult;
|
||||||
use rmcp::model::ServerNotification;
|
use rmcp::model::ServerNotification;
|
||||||
use serde_json::json;
|
|
||||||
use tokio::sync::mpsc;
|
use tokio::sync::mpsc;
|
||||||
|
|
||||||
impl ExtensionManager {
|
impl ExtensionManager {
|
||||||
|
|||||||
@@ -544,7 +544,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_valid_conversation() {
|
fn test_valid_conversation() {
|
||||||
let all_messages = vec![
|
let all_messages = [
|
||||||
Message::user().with_text("Can you help me search for something?"),
|
Message::user().with_text("Can you help me search for something?"),
|
||||||
Message::assistant()
|
Message::assistant()
|
||||||
.with_text("I'll help you search.")
|
.with_text("I'll help you search.")
|
||||||
|
|||||||
@@ -84,8 +84,7 @@ impl ToolPermissionStore {
|
|||||||
self.permissions.get(&key).and_then(|records| {
|
self.permissions.get(&key).and_then(|records| {
|
||||||
records
|
records
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|record| record.expiry.is_none_or(|exp| exp > Utc::now().timestamp()))
|
.rfind(|record| record.expiry.is_none_or(|exp| exp > Utc::now().timestamp()))
|
||||||
.next_back()
|
|
||||||
.map(|record| record.allowed)
|
.map(|record| record.allowed)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ use rmcp::model::{
|
|||||||
object, AnnotateAble, CallToolRequestParam, Content, ErrorCode, ErrorData, RawContent,
|
object, AnnotateAble, CallToolRequestParam, Content, ErrorCode, ErrorData, RawContent,
|
||||||
ResourceContents, Role, Tool,
|
ResourceContents, Role, Tool,
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Serialize;
|
||||||
use serde_json::{json, Value};
|
use serde_json::{json, Value};
|
||||||
use std::borrow::Cow;
|
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.
|
/// Check if the model name indicates a Claude/Anthropic model that supports cache control.
|
||||||
fn is_claude_model(model_name: &str) -> bool {
|
fn is_claude_model(model_name: &str) -> bool {
|
||||||
model_name.contains("claude")
|
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!(
|
assert_eq!(
|
||||||
spec[0]["function"]["parameters"]["$schema"],
|
spec[0]["function"]["parameters"]["$schema"],
|
||||||
"http://json-schema.org/draft-07/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!(spec[0]["function"]["parameters"].get("$schema").is_none());
|
||||||
assert_eq!(spec[0]["function"]["parameters"]["type"], "object");
|
assert_eq!(spec[0]["function"]["parameters"]["type"], "object");
|
||||||
|
|
||||||
|
|||||||
@@ -439,7 +439,7 @@ impl Provider for GcpVertexAIProvider {
|
|||||||
where
|
where
|
||||||
Self: Sized,
|
Self: Sized,
|
||||||
{
|
{
|
||||||
let model_strings: Vec<String> = vec![
|
let model_strings: Vec<String> = [
|
||||||
GcpVertexAIModel::Claude(ClaudeVersion::Sonnet37),
|
GcpVertexAIModel::Claude(ClaudeVersion::Sonnet37),
|
||||||
GcpVertexAIModel::Claude(ClaudeVersion::Sonnet4),
|
GcpVertexAIModel::Claude(ClaudeVersion::Sonnet4),
|
||||||
GcpVertexAIModel::Claude(ClaudeVersion::Opus4),
|
GcpVertexAIModel::Claude(ClaudeVersion::Opus4),
|
||||||
|
|||||||
@@ -23,9 +23,10 @@ pub const CURRENT_SCHEMA_VERSION: i32 = 6;
|
|||||||
pub const SESSIONS_FOLDER: &str = "sessions";
|
pub const SESSIONS_FOLDER: &str = "sessions";
|
||||||
pub const DB_NAME: &str = "sessions.db";
|
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")]
|
#[serde(rename_all = "snake_case")]
|
||||||
pub enum SessionType {
|
pub enum SessionType {
|
||||||
|
#[default]
|
||||||
User,
|
User,
|
||||||
Scheduled,
|
Scheduled,
|
||||||
SubAgent,
|
SubAgent,
|
||||||
@@ -33,12 +34,6 @@ pub enum SessionType {
|
|||||||
Terminal,
|
Terminal,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for SessionType {
|
|
||||||
fn default() -> Self {
|
|
||||||
Self::User
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl std::fmt::Display for SessionType {
|
impl std::fmt::Display for SessionType {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
[toolchain]
|
[toolchain]
|
||||||
channel = "1.88.0"
|
channel = "1.92"
|
||||||
profile = "default"
|
profile = "default"
|
||||||
|
|||||||
Reference in New Issue
Block a user