diff --git a/crates/agent/src/skills.rs b/crates/agent/src/skills.rs index fb7ad901e48c90d90cc3b4886fd06370cfff7c21..6c740b8e5c9cf7e5f978ca1e02f1234714797a3c 100644 --- a/crates/agent/src/skills.rs +++ b/crates/agent/src/skills.rs @@ -476,7 +476,7 @@ mod tests { #[test] fn test_validate_name_mismatch() { - let mut metadata = SkillMetadata { + let metadata = SkillMetadata { name: "bar".to_string(), description: "Valid description".to_string(), license: None, @@ -639,7 +639,7 @@ This is the skill content."#; "exact-skill".to_string(), Arc::new(Skill { name: "exact-skill".to_string(), - description: exact_description.clone(), + description: exact_description, path: PathBuf::from("/exact"), }), ); diff --git a/crates/agent/src/tests/mod.rs b/crates/agent/src/tests/mod.rs index 0c998b893a44e0e5fbc26a5606daca103cae6f82..13c09209be60d27b03255fcaed8f856021d77cc5 100644 --- a/crates/agent/src/tests/mod.rs +++ b/crates/agent/src/tests/mod.rs @@ -9,7 +9,7 @@ use anyhow::Result; use client::{Client, RefreshLlmTokenListener, UserStore}; use collections::IndexMap; use context_server::{ContextServer, ContextServerCommand, ContextServerId}; -use feature_flags::FeatureFlagAppExt as _; + use fs::{FakeFs, Fs}; use futures::{ FutureExt as _, StreamExt, @@ -4565,10 +4565,6 @@ async fn test_subagent_tool_call_end_to_end(cx: &mut TestAppContext) { cx.update(|cx| { LanguageModelRegistry::test(cx); }); - cx.update(|cx| { - cx.update_flags(true, vec!["subagents".to_string()]); - }); - let fs = FakeFs::new(cx.executor()); fs.insert_tree( "/", @@ -4700,10 +4696,6 @@ async fn test_subagent_tool_output_does_not_include_thinking(cx: &mut TestAppCon cx.update(|cx| { LanguageModelRegistry::test(cx); }); - cx.update(|cx| { - cx.update_flags(true, vec!["subagents".to_string()]); - }); - let fs = FakeFs::new(cx.executor()); fs.insert_tree( "/", @@ -4848,10 +4840,6 @@ async fn test_subagent_tool_call_cancellation_during_task_prompt(cx: &mut TestAp cx.update(|cx| { LanguageModelRegistry::test(cx); }); - cx.update(|cx| { - cx.update_flags(true, vec!["subagents".to_string()]); - }); - let fs = FakeFs::new(cx.executor()); fs.insert_tree( "/", @@ -4978,10 +4966,6 @@ async fn test_subagent_tool_resume_session(cx: &mut TestAppContext) { cx.update(|cx| { LanguageModelRegistry::test(cx); }); - cx.update(|cx| { - cx.update_flags(true, vec!["subagents".to_string()]); - }); - let fs = FakeFs::new(cx.executor()); fs.insert_tree( "/", @@ -5156,10 +5140,6 @@ async fn test_subagent_tool_resume_session(cx: &mut TestAppContext) { async fn test_subagent_tool_is_present_when_feature_flag_enabled(cx: &mut TestAppContext) { init_test(cx); - cx.update(|cx| { - cx.update_flags(true, vec!["subagents".to_string()]); - }); - let fs = FakeFs::new(cx.executor()); fs.insert_tree(path!("/test"), json!({})).await; let project = Project::test(fs, [path!("/test").as_ref()], cx).await; @@ -5198,10 +5178,6 @@ async fn test_subagent_tool_is_present_when_feature_flag_enabled(cx: &mut TestAp async fn test_subagent_thread_inherits_parent_thread_properties(cx: &mut TestAppContext) { init_test(cx); - cx.update(|cx| { - cx.update_flags(true, vec!["subagents".to_string()]); - }); - let fs = FakeFs::new(cx.executor()); fs.insert_tree(path!("/test"), json!({})).await; let project = Project::test(fs, [path!("/test").as_ref()], cx).await; @@ -5246,10 +5222,6 @@ async fn test_subagent_thread_inherits_parent_thread_properties(cx: &mut TestApp async fn test_max_subagent_depth_prevents_tool_registration(cx: &mut TestAppContext) { init_test(cx); - cx.update(|cx| { - cx.update_flags(true, vec!["subagents".to_string()]); - }); - let fs = FakeFs::new(cx.executor()); fs.insert_tree(path!("/test"), json!({})).await; let project = Project::test(fs, [path!("/test").as_ref()], cx).await; @@ -5296,10 +5268,6 @@ async fn test_max_subagent_depth_prevents_tool_registration(cx: &mut TestAppCont async fn test_parent_cancel_stops_subagent(cx: &mut TestAppContext) { init_test(cx); - cx.update(|cx| { - cx.update_flags(true, vec!["subagents".to_string()]); - }); - let fs = FakeFs::new(cx.executor()); fs.insert_tree(path!("/test"), json!({})).await; let project = Project::test(fs, [path!("/test").as_ref()], cx).await; @@ -5355,10 +5323,6 @@ async fn test_subagent_context_window_warning(cx: &mut TestAppContext) { cx.update(|cx| { LanguageModelRegistry::test(cx); }); - cx.update(|cx| { - cx.update_flags(true, vec!["subagents".to_string()]); - }); - let fs = FakeFs::new(cx.executor()); fs.insert_tree( "/", @@ -5481,10 +5445,6 @@ async fn test_subagent_no_context_window_warning_when_already_at_warning(cx: &mu cx.update(|cx| { LanguageModelRegistry::test(cx); }); - cx.update(|cx| { - cx.update_flags(true, vec!["subagents".to_string()]); - }); - let fs = FakeFs::new(cx.executor()); fs.insert_tree( "/", @@ -5655,10 +5615,6 @@ async fn test_subagent_error_propagation(cx: &mut TestAppContext) { cx.update(|cx| { LanguageModelRegistry::test(cx); }); - cx.update(|cx| { - cx.update_flags(true, vec!["subagents".to_string()]); - }); - let fs = FakeFs::new(cx.executor()); fs.insert_tree( "/", diff --git a/crates/agent/src/tools/list_directory_tool.rs b/crates/agent/src/tools/list_directory_tool.rs index e822d7b670f1e5884da1f9cb72b8f5dd80098442..428a5f83ddcf53eb2e704517dadff26101299f04 100644 --- a/crates/agent/src/tools/list_directory_tool.rs +++ b/crates/agent/src/tools/list_directory_tool.rs @@ -12,7 +12,7 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use settings::Settings; use std::fmt::Write; -use std::path::PathBuf; + use std::sync::Arc; use util::markdown::MarkdownInlineCode; diff --git a/crates/agent/src/tools/read_file_tool.rs b/crates/agent/src/tools/read_file_tool.rs index fb33588c140155c2fab7a5696166c2257deaa05a..bbd246594247419cead1a29f857f26101b7687f1 100644 --- a/crates/agent/src/tools/read_file_tool.rs +++ b/crates/agent/src/tools/read_file_tool.rs @@ -10,7 +10,7 @@ use project::{AgentLocation, ImageItem, Project, WorktreeSettings, image_store}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use settings::Settings; -use std::path::PathBuf; + use std::sync::Arc; use util::markdown::MarkdownCodeBlock;