Update candle to 0.9 (#6913)

This commit is contained in:
jh-block
2026-02-03 14:59:52 +01:00
committed by GitHub
parent 0f334dbd45
commit a3f93ad532
8 changed files with 270 additions and 239 deletions
+5 -5
View File
@@ -93,9 +93,9 @@ unicode-normalization = "0.1"
goose-mcp = { path = "../goose-mcp" }
# For local Whisper transcription
candle-core = { version = "0.8.4" }
candle-nn = { version = "0.8.4" }
candle-transformers = { version = "0.8.4" }
candle-core = { version = "0.9", default-features = false }
candle-nn = { version = "0.9", default-features = false }
candle-transformers = { version = "0.9", default-features = false }
byteorder = "1.5.0"
tokenizers = "0.21.0"
hf-hub = { version = "0.4.3", default-features = false, features = ["tokio"] }
@@ -120,8 +120,8 @@ winapi = { version = "0.3", features = ["wincred"] }
# Platform-specific GPU acceleration for Whisper
[target.'cfg(target_os = "macos")'.dependencies]
candle-core = { version = "0.8.4", features = ["metal"] }
candle-nn = { version = "0.8.4", features = ["metal"] }
candle-core = { version = "0.9", default-features = false, features = ["metal"] }
candle-nn = { version = "0.9", default-features = false, features = ["metal"] }
[dev-dependencies]
serial_test = { workspace = true }
@@ -201,7 +201,7 @@ struct ToolInfo {
impl ToolInfo {
fn from_mcp_tool(tool: &McpTool) -> Option<Self> {
let (server_name, tool_name) = tool.name.as_ref().split_once("__")?;
let (server_name, tool_name) = tool.name.split_once("__")?;
let param_names = get_parameter_names(tool);
let mut schema_value = Value::Object(tool.input_schema.as_ref().clone());
@@ -235,11 +235,11 @@ impl ToolInfo {
Some(Self {
server_name: server_name.to_string(),
tool_name: tool_name.to_string(),
full_name: tool.name.as_ref().to_string(),
full_name: tool.name.to_string(),
description: tool
.description
.as_ref()
.map(|d| d.as_ref().to_string())
.map(|d| d.to_string())
.unwrap_or_default(),
params,
return_type,
+1 -1
View File
@@ -791,7 +791,7 @@ impl ExtensionManager {
tools
.iter()
.filter(|tool| {
let tool_prefix = tool.name.as_ref().split("__").next().unwrap_or("");
let tool_prefix = tool.name.split("__").next().unwrap_or("");
if let Some(ref excluded) = exclude_normalized {
if tool_prefix == excluded {
+1 -1
View File
@@ -33,7 +33,7 @@ impl SearchPaths {
Self {
paths: paths
.into_iter()
.map(|s| PathBuf::from(shellexpand::tilde(&s).as_ref()))
.map(|s| PathBuf::from(&*shellexpand::tilde(&s)))
.collect(),
}
}
@@ -131,8 +131,8 @@ impl ToolInspector for PermissionInspector {
}
}
// 2. Check if it's a readonly or regular tool (both pre-approved)
else if self.readonly_tools.contains(tool_name.as_ref())
|| self.regular_tools.contains(tool_name.as_ref())
else if self.readonly_tools.contains(&**tool_name)
|| self.regular_tools.contains(&**tool_name)
{
InspectionAction::Allow
}
@@ -153,9 +153,9 @@ impl ToolInspector for PermissionInspector {
InspectionAction::Allow => {
if goose_mode == GooseMode::Auto {
"Auto mode - all tools approved".to_string()
} else if self.readonly_tools.contains(tool_name.as_ref()) {
} else if self.readonly_tools.contains(&**tool_name) {
"Tool marked as read-only".to_string()
} else if self.regular_tools.contains(tool_name.as_ref()) {
} else if self.regular_tools.contains(&**tool_name) {
"Tool pre-approved".to_string()
} else {
"User permission allows this tool".to_string()
+2 -2
View File
@@ -697,7 +697,7 @@ impl SessionStorage {
.bind(&session.name)
.bind(session.user_set_name)
.bind(session.session_type.to_string())
.bind(session.working_dir.to_string_lossy().as_ref())
.bind(&*session.working_dir.to_string_lossy())
.bind(session.created_at)
.bind(session.updated_at)
.bind(serde_json::to_string(&session.extension_data)?)
@@ -924,7 +924,7 @@ impl SessionStorage {
.bind(&today)
.bind(&name)
.bind(session_type.to_string())
.bind(working_dir.to_string_lossy().as_ref())
.bind(&*working_dir.to_string_lossy())
.fetch_one(&mut *tx)
.await?;
+1 -2
View File
@@ -65,8 +65,7 @@ impl TokenCounter {
let name = &tool.name;
let description = &tool
.description
.as_ref()
.map(|d| d.as_ref())
.as_deref()
.unwrap_or_default()
.trim_end_matches('.');