Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
agent: Remove experimental plan and title agent tools (#58824)
Ben Brandtf8226fd1eb1f
diff --git a/assets/settings/default.json b/assets/settings/default.jsonindex a258e0ea4d4..326182ff519 100644--- a/assets/settings/default.json+++ b/assets/settings/default.json@@ -1128,8 +1128,6 @@"skill": true,"spawn_agent": true,"terminal": true,- "update_plan": true,- "update_title": true,"search_web": true,},},@@ -1151,8 +1149,6 @@"grep": true,"skill": true,"spawn_agent": true,- "update_plan": true,- "update_title": true,"search_web": true,},},diff --git a/crates/agent/src/agent.rs b/crates/agent/src/agent.rsindex 9e17d3b21f1..6b4b81e7426 100644--- a/crates/agent/src/agent.rs+++ b/crates/agent/src/agent.rs@@ -2091,9 +2091,6 @@ impl NativeAgentConnection {thread.update_tool_call(update, cx)})??;}- ThreadEvent::Plan(plan) => {- acp_thread.update(cx, |thread, cx| thread.update_plan(plan, cx))?;- }ThreadEvent::SubagentSpawned(session_id) => {acp_thread.update(cx, |thread, cx| {thread.subagent_spawned(session_id, cx);diff --git a/crates/agent/src/templates.rs b/crates/agent/src/templates.rsindex a946c404dc7..5d8db7833c9 100644--- a/crates/agent/src/templates.rs+++ b/crates/agent/src/templates.rs@@ -89,7 +89,7 @@ mod tests {let project = prompt_store::ProjectContext::default();let template = SystemPromptTemplate {project: &project,- available_tools: vec!["echo".into(), "update_plan".into(), "update_title".into()],+ available_tools: vec!["echo".into()],model_name: Some("test-model".to_string()),date: "2026-01-01".to_string(),user_agents_md: None,@@ -100,8 +100,6 @@ mod tests {assert!(rendered.contains("You are the Zed coding agent"));assert!(rendered.contains("Today's Date: 2026-01-01"));assert!(rendered.contains("## Fixing Diagnostics"));- assert!(rendered.contains("## Planning"));- assert!(rendered.contains("## Session Title"));assert!(rendered.contains("test-model"));}diff --git a/crates/agent/src/templates/experimental_system_prompt.hbs b/crates/agent/src/templates/experimental_system_prompt.hbsindex 63a34ccdcad..7a348cca062 100644--- a/crates/agent/src/templates/experimental_system_prompt.hbs+++ b/crates/agent/src/templates/experimental_system_prompt.hbs@@ -30,40 +30,6 @@ You are the Zed coding agent running inside the Zed editor. You help users compl- Autonomously resolve the task to the best of your ability with the tools available rather than coming back to the user prematurely. Ask the user only when the information you need is genuinely unavailable from the project, or when proceeding without clarification would be risky.- Do not guess or make up an answer.-{{#if (contains available_tools 'update_plan') }}-## Planning--- You have access to an `update_plan` tool that tracks steps and progress and renders them to the user.-- Use it to show that you understand the task and to make complex, ambiguous, or multi-phase work easier to follow.-- A good plan is short, concrete, logically ordered, and easy to verify. Each step should describe a real unit of work.-- Mark completed steps promptly before moving to the next phase.-- Do not use plans for simple or single-step queries that you can answer or complete immediately.-- Do not pad plans with filler steps, obvious actions, or work you are not capable of doing.-- After calling `update_plan`, do not repeat the full plan in your response. The UI already displays it. Briefly summarize any important change and continue.-- You can mark multiple steps completed in a single `update_plan` call.-- If the task changes midway through, update the plan so it reflects the new approach.--Use a plan when:--- The task is non-trivial and will require multiple actions over a longer horizon.-- There are logical phases or dependencies where sequencing matters.-- The work has ambiguity that benefits from outlining high-level goals.-- You want intermediate checkpoints for feedback and validation.-- The user asked you to do more than one thing in a single prompt.-- You discover additional steps while working and intend to complete them before yielding to the user.--{{/if}}-{{#if (contains available_tools 'update_title') }}-## Session Title--- Use the `update_title` tool to set the title shown to the user for the current session.-- You MUST set a title at least once, even for small tasks. Do it early in the conversation, after the first user message, before you start working. There is no title to begin with, so you are responsible for setting one.-- Update the title again whenever the goal changes materially.-- Titles are very important to communicate to the user what you are working on. A session should always have a title.-- Keep titles concise and specific. Prefer a short noun phrase over a full sentence, and do not wrap the title in quotes.-- Do not mention that you changed the title unless it is directly relevant to the user.--{{/if}}## Searching and ReadingIf you are unsure how to fulfill the user's request, gather more information with tool calls and/or clarifying questions.diff --git a/crates/agent/src/templates/system_prompt.hbs b/crates/agent/src/templates/system_prompt.hbsindex 38d96632f27..da18674b255 100644--- a/crates/agent/src/templates/system_prompt.hbs+++ b/crates/agent/src/templates/system_prompt.hbs@@ -50,40 +50,6 @@ Mermaid diagrams are automatically color-coded using the user's theme accent pal- Autonomously resolve the task to the best of your ability with the tools available rather than coming back to the user prematurely. Ask the user only when the information you need is genuinely unavailable from the project, or when proceeding without clarification would be risky.- Do not guess or make up an answer.-{{#if (contains available_tools 'update_plan') }}-## Planning--- You have access to an `update_plan` tool that tracks steps and progress and renders them to the user.-- Use it to show that you understand the task and to make complex, ambiguous, or multi-phase work easier to follow.-- A good plan is short, concrete, logically ordered, and easy to verify. Each step should describe a real unit of work.-- Mark completed steps promptly before moving to the next phase.-- Do not use plans for simple or single-step queries that you can answer or complete immediately.-- Do not pad plans with filler steps, obvious actions, or work you are not capable of doing.-- After calling `update_plan`, do not repeat the full plan in your response. The UI already displays it. Briefly summarize any important change and continue.-- You can mark multiple steps completed in a single `update_plan` call.-- If the task changes midway through, update the plan so it reflects the new approach.--Use a plan when:--- The task is non-trivial and will require multiple actions over a longer horizon.-- There are logical phases or dependencies where sequencing matters.-- The work has ambiguity that benefits from outlining high-level goals.-- You want intermediate checkpoints for feedback and validation.-- The user asked you to do more than one thing in a single prompt.-- You discover additional steps while working and intend to complete them before yielding to the user.--{{/if}}-{{#if (contains available_tools 'update_title') }}-## Session Title--- Use the `update_title` tool to set the title shown to the user for the current session.-- You MUST set a title at least once, even for small tasks. Do it early in the conversation, after the first user message, before you start working. There is no title to begin with, so you are responsible for setting one.-- Update the title again whenever the goal changes materially.-- Titles are very important to communicate to the user what you are working on. A session should always have a title.-- Keep titles concise and specific. Prefer a short noun phrase over a full sentence, and do not wrap the title in quotes.-- Do not mention that you changed the title unless it is directly relevant to the user.--{{/if}}## Searching and ReadingIf you are unsure how to fulfill the user's request, gather more information with tool calls and/or clarifying questions.diff --git a/crates/agent/src/tests/mod.rs b/crates/agent/src/tests/mod.rsindex 9647726645d..beb1997309b 100644--- a/crates/agent/src/tests/mod.rs+++ b/crates/agent/src/tests/mod.rs@@ -1030,20 +1030,6 @@ async fn expect_tool_call_update_fields(}}-async fn expect_plan(events: &mut UnboundedReceiver<Result<ThreadEvent>>) -> acp::Plan {- let event = events- .next()- .await- .expect("no plan event received")- .unwrap();- match event {- ThreadEvent::Plan(plan) => plan,- event => {- panic!("Unexpected event {event:?}");- }- }-}-async fn next_tool_call_authorization(events: &mut UnboundedReceiver<Result<ThreadEvent>>,) -> ToolCallAuthorization {@@ -3919,270 +3905,6 @@ async fn test_tool_updates_to_completion(cx: &mut TestAppContext) {);}-#[gpui::test]-async fn test_update_plan_tool_updates_thread_events(cx: &mut TestAppContext) {- let ThreadTest { thread, model, .. } = setup(cx, TestModel::Fake).await;- cx.update(|cx| {- cx.update_flags(true, vec!["update-plan-tool".to_string()]);- });- thread.update(cx, |thread, _cx| thread.add_tool(UpdatePlanTool));- let fake_model = model.as_fake();-- let mut events = thread- .update(cx, |thread, cx| {- thread.send(UserMessageId::new(), ["Make a plan"], cx)- })- .unwrap();- cx.run_until_parked();-- let input = json!({- "plan": [- {- "step": "Inspect the code",- "status": "completed",- },- {- "step": "Implement the tool",- "status": "in_progress"- },- {- "step": "Run tests",- "status": "pending",- }- ]- });- fake_model.send_last_completion_stream_event(LanguageModelCompletionEvent::ToolUse(- LanguageModelToolUse {- id: "plan_1".into(),- name: UpdatePlanTool::NAME.into(),- raw_input: input.to_string(),- input,- is_input_complete: true,- thought_signature: None,- },- ));- fake_model.end_last_completion_stream();- cx.run_until_parked();-- let tool_call = expect_tool_call(&mut events).await;- assert_eq!(- tool_call,- acp::ToolCall::new("plan_1", "Update plan")- .kind(acp::ToolKind::Think)- .raw_input(json!({- "plan": [- {- "step": "Inspect the code",- "status": "completed",- },- {- "step": "Implement the tool",- "status": "in_progress"- },- {- "step": "Run tests",- "status": "pending",- }- ]- }))- .meta(acp::Meta::from_iter([(- "tool_name".into(),- "update_plan".into()- )]))- );-- let update = expect_tool_call_update_fields(&mut events).await;- assert_eq!(- update,- acp::ToolCallUpdate::new(- "plan_1",- acp::ToolCallUpdateFields::new().status(acp::ToolCallStatus::InProgress)- )- );-- let plan = expect_plan(&mut events).await;- assert_eq!(- plan,- acp::Plan::new(vec![- acp::PlanEntry::new(- "Inspect the code",- acp::PlanEntryPriority::Medium,- acp::PlanEntryStatus::Completed,- ),- acp::PlanEntry::new(- "Implement the tool",- acp::PlanEntryPriority::Medium,- acp::PlanEntryStatus::InProgress,- ),- acp::PlanEntry::new(- "Run tests",- acp::PlanEntryPriority::Medium,- acp::PlanEntryStatus::Pending,- ),- ])- );-- let update = expect_tool_call_update_fields(&mut events).await;- assert_eq!(- update,- acp::ToolCallUpdate::new(- "plan_1",- acp::ToolCallUpdateFields::new()- .status(acp::ToolCallStatus::Completed)- .raw_output("Plan updated")- )- );-}--#[gpui::test]-async fn test_update_title_tool_sets_thread_title(cx: &mut TestAppContext) {- let ThreadTest { thread, model, .. } = setup(cx, TestModel::Fake).await;- let fake_model = model.as_fake();- let summary_model = Arc::new(FakeLanguageModel::default());-- cx.update(|cx| {- cx.update_flags(true, vec!["update-title-tool".to_string()]);- });- thread.update(cx, |thread, cx| {- thread.add_tool(UpdateTitleTool::new(cx.weak_entity()));- thread.set_summarization_model(Some(summary_model.clone()), cx);- });-- let mut events = thread- .update(cx, |thread, cx| {- thread.send(UserMessageId::new(), ["Explore title tooling"], cx)- })- .unwrap();- cx.run_until_parked();-- let input = json!({- "title": "Session title tool"- });- fake_model.send_last_completion_stream_event(LanguageModelCompletionEvent::ToolUse(- LanguageModelToolUse {- id: "title_1".into(),- name: UpdateTitleTool::NAME.into(),- raw_input: input.to_string(),- input,- is_input_complete: true,- thought_signature: None,- },- ));- fake_model.end_last_completion_stream();- cx.run_until_parked();-- let tool_call = expect_tool_call(&mut events).await;- assert_eq!(- tool_call,- acp::ToolCall::new("title_1", "Update title: Session title tool")- .kind(acp::ToolKind::Think)- .raw_input(json!({- "title": "Session title tool"- }))- .meta(acp::Meta::from_iter([(- "tool_name".into(),- "update_title".into()- )]))- );-- let update = expect_tool_call_update_fields(&mut events).await;- assert_eq!(- update,- acp::ToolCallUpdate::new(- "title_1",- acp::ToolCallUpdateFields::new().status(acp::ToolCallStatus::InProgress)- )- );-- let update = expect_tool_call_update_fields(&mut events).await;- assert_eq!(- update,- acp::ToolCallUpdate::new(- "title_1",- acp::ToolCallUpdateFields::new()- .status(acp::ToolCallStatus::Completed)- .raw_output("Session title updated")- )- );-- thread.read_with(cx, |thread, _| {- assert_eq!(thread.title(), Some("Session title tool".into()));- });- assert_eq!(summary_model.pending_completions(), Vec::new());-}--#[gpui::test]-async fn test_update_title_availability_suppresses_summary_title_generation(- cx: &mut TestAppContext,-) {- let ThreadTest { thread, model, .. } = setup(cx, TestModel::Fake).await;- let fake_model = model.as_fake();- let summary_model = Arc::new(FakeLanguageModel::default());-- cx.update(|cx| {- cx.update_flags(true, vec!["update-title-tool".to_string()]);- });- thread.update(cx, |thread, cx| {- thread.add_tool(UpdateTitleTool::new(cx.weak_entity()));- thread.set_summarization_model(Some(summary_model.clone()), cx);- });-- let send = thread- .update(cx, |thread, cx| {- thread.send(UserMessageId::new(), ["Explore title tooling"], cx)- })- .unwrap();- cx.run_until_parked();-- fake_model.send_last_completion_stream_text_chunk("Done");- fake_model.end_last_completion_stream();- send.collect::<Vec<_>>().await;- cx.run_until_parked();-- thread.read_with(cx, |thread, _| {- assert_eq!(thread.title(), None);- });- assert_eq!(summary_model.pending_completions(), Vec::new());-}--#[gpui::test]-async fn test_update_title_flag_without_available_tool_falls_back_to_summary_title_generation(- cx: &mut TestAppContext,-) {- let ThreadTest { thread, model, .. } = setup(cx, TestModel::Fake).await;- let fake_model = model.as_fake();- let summary_model = Arc::new(FakeLanguageModel::default());-- cx.update(|cx| {- cx.update_flags(true, vec!["update-title-tool".to_string()]);- });- thread.update(cx, |thread, cx| {- thread.set_summarization_model(Some(summary_model.clone()), cx);- });-- let send = thread- .update(cx, |thread, cx| {- thread.send(UserMessageId::new(), ["Explore title tooling"], cx)- })- .unwrap();- cx.run_until_parked();-- fake_model.send_last_completion_stream_text_chunk("Done");- fake_model.end_last_completion_stream();- cx.run_until_parked();-- assert_eq!(summary_model.pending_completions().len(), 1);-- summary_model.send_last_completion_stream_text_chunk("Fallback title");- summary_model.end_last_completion_stream();- send.collect::<Vec<_>>().await;- cx.run_until_parked();-- thread.read_with(cx, |thread, _| {- assert_eq!(thread.title(), Some("Fallback title".into()));- });-}-#[gpui::test]async fn test_send_no_retry_on_success(cx: &mut TestAppContext) {let ThreadTest { thread, model, .. } = setup(cx, TestModel::Fake).await;@@ -4695,8 +4417,6 @@ async fn setup(cx: &mut TestAppContext, model: TestModel) -> ThreadTest {StreamingJsonErrorContextTool::NAME: true,StreamingFailingEchoTool::NAME: true,TerminalTool::NAME: true,- UpdatePlanTool::NAME: true,- UpdateTitleTool::NAME: true,}}}diff --git a/crates/agent/src/thread.rs b/crates/agent/src/thread.rsindex eedfc64c526..b8406547982 100644--- a/crates/agent/src/thread.rs+++ b/crates/agent/src/thread.rs@@ -4,16 +4,13 @@ use crate::{FetchTool, FindPathTool, FindReferencesTool, GetCodeActionsTool, GoToDefinitionTool, GrepTool,ListAgentsAndModelsTool, ListDirectoryTool, MovePathTool, ProjectSnapshot, ReadFileTool,RenameTool, SandboxedTerminalTool, SpawnAgentTool, SystemPromptTemplate, Template, Templates,- TerminalTool, ToolPermissionDecision, UpdatePlanTool, UpdateTitleTool, WebSearchTool,- WriteFileTool, decide_permission_from_settings,+ TerminalTool, ToolPermissionDecision, WebSearchTool, WriteFileTool,+ decide_permission_from_settings,};use acp_thread::{MentionUri, UserMessageId};use action_log::ActionLog;use agent_settings::UserAgentsMd;-use feature_flags::{- FeatureFlagAppExt as _, HandoffFeatureFlag, UpdatePlanToolFeatureFlag,- UpdateTitleToolFeatureFlag,-};+use feature_flags::{FeatureFlagAppExt as _, HandoffFeatureFlag};use zed_env_vars::{EnvVar, env_var};use crate::sandboxing::{SandboxRequest, ThreadSandboxGrants, sandboxing_enabled};@@ -836,7 +833,6 @@ pub enum ThreadEvent {AgentThinking(String),ToolCall(acp::ToolCall),ToolCallUpdate(acp_thread::ToolCallUpdate),- Plan(acp::Plan),ToolCallAuthorization(ToolCallAuthorization),SubagentSpawned(acp::SessionId),Retry(acp_thread::RetryStatus),@@ -1475,11 +1471,10 @@ impl Thread {// but still display the saved result if available.// We need to send both ToolCall and ToolCallUpdate events because the UI// only converts raw_output to displayable content in update_fields, not from_acp.- let title = Self::title_for_replayed_tool_use(tool_use);stream.0.unbounded_send(Ok(ThreadEvent::ToolCall(- acp::ToolCall::new(tool_use.id.to_string(), title.clone())+ acp::ToolCall::new(tool_use.id.to_string(), tool_use.name.to_string()).status(status).raw_input(tool_use.input.clone()),)))@@ -1487,9 +1482,6 @@ impl Thread {let mut fields = acp::ToolCallUpdateFields::new().status(status).raw_output(output);- if tool_use.name.as_ref() == UpdateTitleTool::NAME {- fields = fields.title(title);- }if let Some(content) = replay_content {fields = fields.content(content);}@@ -1538,16 +1530,6 @@ impl Thread {);}- fn title_for_replayed_tool_use(tool_use: &LanguageModelToolUse) -> String {- if tool_use.name.as_ref() == UpdateTitleTool::NAME {- let input = serde_json::from_value(tool_use.input.clone())- .map_err(|_| serde_json::Value::String(tool_use.raw_input.clone()));- UpdateTitleTool::title_for_input(input).to_string()- } else {- tool_use.name.to_string()- }- }-fn tool_result_content_for_replay(tool_result: &LanguageModelToolResult,) -> Option<Vec<acp::ToolCallContent>> {@@ -1914,12 +1896,6 @@ impl Thread {self.add_tool(GrepTool::new(self.project.clone()));self.add_tool(ListDirectoryTool::new(self.project.clone()));self.add_tool(MovePathTool::new(self.project.clone()));- if cx.has_flag::<UpdatePlanToolFeatureFlag>() {- self.add_tool(UpdatePlanTool);- }- if cx.has_flag::<UpdateTitleToolFeatureFlag>() {- self.add_tool(UpdateTitleTool::new(cx.weak_entity()));- }self.add_tool(ReadFileTool::new(self.project.clone(),self.action_log.clone(),@@ -3180,18 +3156,8 @@ impl Thread {self.title_generation_failed}- pub fn can_generate_title(&self, cx: &App) -> bool {- self.pending_title_generation.is_none()- && self.summarization_model.is_some()- && !self.update_title_tool_available(cx)- }-- fn update_title_tool_available(&self, cx: &App) -> bool {- if let Some(running_turn) = self.running_turn.as_ref() {- running_turn.tools.contains_key(UpdateTitleTool::NAME)- } else {- self.enabled_tools(cx).contains_key(UpdateTitleTool::NAME)- }+ pub fn can_generate_title(&self) -> bool {+ self.pending_title_generation.is_none() && self.summarization_model.is_some()}pub fn summary(&mut self, cx: &mut Context<Self>) -> Shared<Task<Option<SharedString>>> {@@ -3255,7 +3221,7 @@ impl Thread {}pub fn generate_title(&mut self, cx: &mut Context<Self>) {- if !self.can_generate_title(cx) {+ if !self.can_generate_title() {return;}let Some(model) = self.summarization_model.clone() else {@@ -4514,10 +4480,6 @@ impl ThreadEventStream {.ok();}- fn send_plan(&self, plan: acp::Plan) {- self.0.unbounded_send(Ok(ThreadEvent::Plan(plan))).ok();- }-fn send_retry(&self, status: acp_thread::RetryStatus) {self.0.unbounded_send(Ok(ThreadEvent::Retry(status))).ok();}@@ -4681,10 +4643,6 @@ impl ToolCallEventStream {.ok();}- pub fn update_plan(&self, plan: acp::Plan) {- self.stream.send_plan(plan);- }-/// Authorize a third-party tool (e.g., MCP tool from a context server).////// Unlike built-in tools, third-party tools don't support pattern-based permissions.@@ -5347,15 +5305,6 @@ impl ToolCallEventStreamReceiver {panic!("Expected terminal but got: {:?}", event);}}-- pub async fn expect_plan(&mut self) -> acp::Plan {- let event = self.0.next().await;- if let Some(Ok(ThreadEvent::Plan(plan))) = event {- plan- } else {- panic!("Expected plan but got: {:?}", event);- }- }}#[cfg(any(test, feature = "test-support"))]@@ -6222,134 +6171,6 @@ mod tests {assert!(tool_use_ids_with_image_content.contains(&missing_tool_use_id.to_string()));}- #[gpui::test]- async fn test_update_title_tool_replay_does_not_reenter_thread(cx: &mut TestAppContext) {- let (thread, _event_stream) = setup_thread_for_test(cx).await;-- let tool_use_id = LanguageModelToolUseId::from("title_tool_id");- let mut replay_events = cx.update(|cx| {- thread.update(cx, |thread, cx| {- thread.add_tool(UpdateTitleTool::new(cx.weak_entity()));- push_completed_update_title_tool_call(thread, tool_use_id.clone());-- thread.replay(cx)- })- });-- let mut saw_tool_call_title = false;- let mut saw_replayed_title_update = false;- let mut saw_completed_update = false;- while let Some(event) = replay_events.next().await {- let event = event.unwrap();- match event {- ThreadEvent::ToolCall(tool_call)- if tool_call.tool_call_id.to_string() == tool_use_id.to_string()- && tool_call.title == "Update title: Replayed title" =>- {- saw_tool_call_title = true;- }- ThreadEvent::ToolCallUpdate(acp_thread::ToolCallUpdate::UpdateFields(update))- if update.tool_call_id.to_string() == tool_use_id.to_string() =>- {- if update.fields.title == Some("Update title: Replayed title".to_string()) {- saw_replayed_title_update = true;- }- if update.fields.status == Some(acp::ToolCallStatus::Completed) {- saw_completed_update = true;- }- }- _ => {}- }- }-- assert!(saw_tool_call_title);- assert!(saw_replayed_title_update);- assert!(saw_completed_update);- thread.read_with(cx, |thread, _cx| {- assert_eq!(thread.title(), None);- });- }-- #[gpui::test]- async fn test_update_title_tool_replay_title_when_tool_not_registered(cx: &mut TestAppContext) {- let (thread, _event_stream) = setup_thread_for_test(cx).await;-- let tool_use_id = LanguageModelToolUseId::from("title_tool_id");- let mut replay_events = cx.update(|cx| {- thread.update(cx, |thread, cx| {- push_completed_update_title_tool_call(thread, tool_use_id.clone());- thread.replay(cx)- })- });-- let mut saw_tool_call_title = false;- let mut saw_replayed_title_update = false;- let mut saw_completed_update = false;- while let Some(event) = replay_events.next().await {- let event = event.unwrap();- match event {- ThreadEvent::ToolCall(tool_call)- if tool_call.tool_call_id.to_string() == tool_use_id.to_string()- && tool_call.title == "Update title: Replayed title" =>- {- saw_tool_call_title = true;- }- ThreadEvent::ToolCallUpdate(acp_thread::ToolCallUpdate::UpdateFields(update))- if update.tool_call_id.to_string() == tool_use_id.to_string() =>- {- if update.fields.title == Some("Update title: Replayed title".to_string()) {- saw_replayed_title_update = true;- }- if update.fields.status == Some(acp::ToolCallStatus::Completed) {- saw_completed_update = true;- }- }- _ => {}- }- }-- assert!(saw_tool_call_title);- assert!(saw_replayed_title_update);- assert!(saw_completed_update);- thread.read_with(cx, |thread, _cx| {- assert_eq!(thread.title(), None);- });- }-- fn push_completed_update_title_tool_call(- thread: &mut Thread,- tool_use_id: LanguageModelToolUseId,- ) {- let tool_use = LanguageModelToolUse {- id: tool_use_id.clone(),- name: UpdateTitleTool::NAME.into(),- raw_input: json!({ "title": "Replayed title" }).to_string(),- input: json!({ "title": "Replayed title" }),- is_input_complete: true,- thought_signature: None,- };-- let mut tool_results = IndexMap::default();- tool_results.insert(- tool_use_id.clone(),- LanguageModelToolResult {- tool_use_id,- tool_name: UpdateTitleTool::NAME.into(),- is_error: false,- content: vec![LanguageModelToolResultContent::Text(- "Session title updated".into(),- )],- output: Some(json!("Session title updated")),- },- );-- thread.messages.push(Arc::new(Message::Agent(AgentMessage {- content: vec![AgentMessageContent::ToolUse(tool_use)],- tool_results,- reasoning_details: None,- })));- }-#[gpui::test]async fn test_set_model_propagates_to_subagents(cx: &mut TestAppContext) {let (parent, _event_stream) = setup_thread_for_test(cx).await;diff --git a/crates/agent/src/tools.rs b/crates/agent/src/tools.rsindex 93762b604b7..f2e92dd2857 100644--- a/crates/agent/src/tools.rs+++ b/crates/agent/src/tools.rs@@ -25,15 +25,12 @@ mod spawn_agent_tool;mod symbol_locator;mod terminal_tool;mod tool_permissions;-mod update_plan_tool;-mod update_title_tool;mod web_search_tool;mod write_file_tool;use crate::AgentTool;use feature_flags::{CreateThreadToolFeatureFlag, FeatureFlagAppExt as _, LspToolFeatureFlag, RenameToolFeatureFlag,- UpdatePlanToolFeatureFlag, UpdateTitleToolFeatureFlag,};use gpui::App;use language_model::{LanguageModelRequestTool, LanguageModelToolSchemaFormat};@@ -89,8 +86,6 @@ pub use spawn_agent_tool::*;pub use symbol_locator::*;pub use terminal_tool::*;pub use tool_permissions::*;-pub use update_plan_tool::*;-pub use update_title_tool::*;pub use web_search_tool::*;pub use write_file_tool::*;@@ -199,8 +194,6 @@ tools! {SkillTool,SpawnAgentTool,TerminalTool,- UpdatePlanTool,- UpdateTitleTool,WebSearchTool,WriteFileTool,}@@ -222,8 +215,6 @@ pub fn tool_feature_flag_enabled(tool_name: &str, cx: &App) -> bool {CreateThreadTool::NAME | ListAgentsAndModelsTool::NAME => {cx.has_flag::<CreateThreadToolFeatureFlag>()}- UpdatePlanTool::NAME => cx.has_flag::<UpdatePlanToolFeatureFlag>(),- UpdateTitleTool::NAME => cx.has_flag::<UpdateTitleToolFeatureFlag>(),_ => true,}}diff --git a/crates/agent/src/tools/update_plan_tool.rs b/crates/agent/src/tools/update_plan_tool.rsdeleted file mode 100644index ebc84ad0318..00000000000--- a/crates/agent/src/tools/update_plan_tool.rs+++ /dev/null@@ -1,221 +0,0 @@-use crate::{AgentTool, ToolCallEventStream, ToolInput};-use agent_client_protocol::schema as acp;-use gpui::{App, SharedString, Task};-use schemars::JsonSchema;-use serde::{Deserialize, Serialize};-use std::sync::Arc;--#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq)]-#[serde(rename_all = "snake_case")]-#[schemars(inline)]-pub enum PlanEntryStatus {- /// The task has not started yet.- Pending,- /// The task is currently being worked on.- InProgress,- /// The task has been successfully completed.- Completed,-}--impl From<PlanEntryStatus> for acp::PlanEntryStatus {- fn from(value: PlanEntryStatus) -> Self {- match value {- PlanEntryStatus::Pending => acp::PlanEntryStatus::Pending,- PlanEntryStatus::InProgress => acp::PlanEntryStatus::InProgress,- PlanEntryStatus::Completed => acp::PlanEntryStatus::Completed,- }- }-}--#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq)]-pub struct PlanItem {- /// Human-readable description of what this task aims to accomplish.- pub step: String,- /// The current status of this task.- pub status: PlanEntryStatus,-}--impl From<PlanItem> for acp::PlanEntry {- fn from(value: PlanItem) -> Self {- acp::PlanEntry::new(- value.step,- acp::PlanEntryPriority::Medium,- value.status.into(),- )- }-}--/// Updates the task plan.-///-/// Provide a list of plan entries, each with a step and status.-#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq)]-pub struct UpdatePlanToolInput {- /// The list of plan entries and their current statuses.- pub plan: Vec<PlanItem>,-}--pub struct UpdatePlanTool;--impl UpdatePlanTool {- fn to_plan(input: UpdatePlanToolInput) -> acp::Plan {- acp::Plan::new(input.plan.into_iter().map(Into::into).collect())- }-}--impl AgentTool for UpdatePlanTool {- type Input = UpdatePlanToolInput;- type Output = String;-- const NAME: &'static str = "update_plan";-- fn kind() -> acp::ToolKind {- acp::ToolKind::Think- }-- fn initial_title(- &self,- input: Result<Self::Input, serde_json::Value>,- _cx: &mut App,- ) -> SharedString {- match input {- Ok(input) if input.plan.is_empty() => "Clear plan".into(),- Ok(_) | Err(_) => "Update plan".into(),- }- }-- fn run(- self: Arc<Self>,- input: ToolInput<Self::Input>,- event_stream: ToolCallEventStream,- cx: &mut App,- ) -> Task<Result<Self::Output, Self::Output>> {- cx.spawn(async move |_cx| {- let input = input.recv().await.map_err(|e| e.to_string())?;-- event_stream.update_plan(Self::to_plan(input));-- Ok("Plan updated".to_string())- })- }-- fn replay(- &self,- input: Self::Input,- _output: Self::Output,- event_stream: ToolCallEventStream,- _cx: &mut App,- ) -> anyhow::Result<()> {- event_stream.update_plan(Self::to_plan(input));- Ok(())- }-}--#[cfg(test)]-mod tests {- use super::*;- use crate::ToolCallEventStream;- use gpui::TestAppContext;- use pretty_assertions::assert_eq;-- fn sample_input() -> UpdatePlanToolInput {- UpdatePlanToolInput {- plan: vec![- PlanItem {- step: "Inspect the existing tool wiring".to_string(),- status: PlanEntryStatus::Completed,- },- PlanItem {- step: "Implement the update_plan tool".to_string(),- status: PlanEntryStatus::InProgress,- },- PlanItem {- step: "Add tests".to_string(),- status: PlanEntryStatus::Pending,- },- ],- }- }-- #[gpui::test]- async fn test_run_emits_plan_event(cx: &mut TestAppContext) {- let tool = Arc::new(UpdatePlanTool);- let (event_stream, mut event_rx) = ToolCallEventStream::test();-- let input = sample_input();- let result = cx- .update(|cx| tool.run(ToolInput::resolved(input.clone()), event_stream, cx))- .await- .expect("tool should succeed");-- assert_eq!(result, "Plan updated".to_string());-- let plan = event_rx.expect_plan().await;- assert_eq!(- plan,- acp::Plan::new(vec![- acp::PlanEntry::new(- "Inspect the existing tool wiring",- acp::PlanEntryPriority::Medium,- acp::PlanEntryStatus::Completed,- ),- acp::PlanEntry::new(- "Implement the update_plan tool",- acp::PlanEntryPriority::Medium,- acp::PlanEntryStatus::InProgress,- ),- acp::PlanEntry::new(- "Add tests",- acp::PlanEntryPriority::Medium,- acp::PlanEntryStatus::Pending,- ),- ])- );- }-- #[gpui::test]- async fn test_replay_emits_plan_event(cx: &mut TestAppContext) {- let tool = UpdatePlanTool;- let (event_stream, mut event_rx) = ToolCallEventStream::test();-- let input = sample_input();-- cx.update(|cx| {- tool.replay(input.clone(), "Plan updated".to_string(), event_stream, cx)- .expect("replay should succeed");- });-- let plan = event_rx.expect_plan().await;- assert_eq!(- plan,- acp::Plan::new(vec![- acp::PlanEntry::new(- "Inspect the existing tool wiring",- acp::PlanEntryPriority::Medium,- acp::PlanEntryStatus::Completed,- ),- acp::PlanEntry::new(- "Implement the update_plan tool",- acp::PlanEntryPriority::Medium,- acp::PlanEntryStatus::InProgress,- ),- acp::PlanEntry::new(- "Add tests",- acp::PlanEntryPriority::Medium,- acp::PlanEntryStatus::Pending,- ),- ])- );- }-- #[gpui::test]- async fn test_initial_title(cx: &mut TestAppContext) {- let tool = UpdatePlanTool;-- let title = cx.update(|cx| tool.initial_title(Ok(sample_input()), cx));- assert_eq!(title, SharedString::from("Update plan"));-- let title =- cx.update(|cx| tool.initial_title(Ok(UpdatePlanToolInput { plan: Vec::new() }), cx));- assert_eq!(title, SharedString::from("Clear plan"));- }-}diff --git a/crates/agent/src/tools/update_title_tool.rs b/crates/agent/src/tools/update_title_tool.rsdeleted file mode 100644index b86b82f9ac0..00000000000--- a/crates/agent/src/tools/update_title_tool.rs+++ /dev/null@@ -1,140 +0,0 @@-use crate::{AgentTool, Thread, ToolCallEventStream, ToolInput};-use agent_client_protocol::schema as acp;-use gpui::{App, SharedString, Task, WeakEntity};-use schemars::JsonSchema;-use serde::{Deserialize, Serialize};-use std::sync::Arc;--const MAX_TITLE_LEN: usize = 200;--/// Updates the current session title.-#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq)]-pub struct UpdateTitleToolInput {- /// A concise, human-readable title for the current session.- pub title: String,-}--pub struct UpdateTitleTool {- thread: WeakEntity<Thread>,-}--impl UpdateTitleTool {- pub fn new(thread: WeakEntity<Thread>) -> Self {- Self { thread }- }-- pub(crate) fn title_for_input(- input: Result<UpdateTitleToolInput, serde_json::Value>,- ) -> SharedString {- let Ok(input) = input else {- return "Update title".into();- };- let Ok(title) = normalize_title(&input.title) else {- return "Update title".into();- };- format!("Update title: {title}").into()- }-}--impl AgentTool for UpdateTitleTool {- type Input = UpdateTitleToolInput;- type Output = String;-- const NAME: &'static str = "update_title";-- fn kind() -> acp::ToolKind {- acp::ToolKind::Think- }-- fn initial_title(- &self,- input: Result<Self::Input, serde_json::Value>,- _cx: &mut App,- ) -> SharedString {- Self::title_for_input(input)- }-- fn run(- self: Arc<Self>,- input: ToolInput<Self::Input>,- _event_stream: ToolCallEventStream,- cx: &mut App,- ) -> Task<Result<Self::Output, Self::Output>> {- let thread = self.thread.clone();- cx.spawn(async move |cx| {- let input = input.recv().await.map_err(|error| error.to_string())?;- let title = normalize_title(&input.title)?;-- thread- .update(cx, |thread, cx| {- thread.set_title(title.into(), cx);- })- .map_err(|error| error.to_string())?;-- Ok("Session title updated".to_string())- })- }-- fn replay(- &self,- input: Self::Input,- _output: Self::Output,- event_stream: ToolCallEventStream,- cx: &mut App,- ) -> anyhow::Result<()> {- let title = self.initial_title(Ok(input), cx).to_string();- event_stream.update_fields(acp::ToolCallUpdateFields::new().title(title));- Ok(())- }-}--fn normalize_title(title: &str) -> Result<String, String> {- let title = title.lines().next().unwrap_or("").trim();- if title.is_empty() {- return Err("Title cannot be empty".to_string());- }- Ok(util::truncate_and_trailoff(title, MAX_TITLE_LEN))-}--#[cfg(test)]-mod tests {- use super::*;- use gpui::TestAppContext;-- #[test]- fn test_normalize_title() {- assert_eq!(- normalize_title(" Title from model\nignored").unwrap(),- "Title from model"- );- assert!(normalize_title(" \nignored").is_err());- }-- #[gpui::test]- async fn test_initial_title(cx: &mut TestAppContext) {- let tool = UpdateTitleTool::new(WeakEntity::new_invalid());-- let title = cx.update(|cx| {- tool.initial_title(- Ok(UpdateTitleToolInput {- title: "Investigate title updates".to_string(),- }),- cx,- )- });- assert_eq!(- title,- SharedString::from("Update title: Investigate title updates")- );-- let title = cx.update(|cx| {- tool.initial_title(- Ok(UpdateTitleToolInput {- title: " ".to_string(),- }),- cx,- )- });- assert_eq!(title, SharedString::from("Update title"));- }-}diff --git a/crates/feature_flags/src/flags.rs b/crates/feature_flags/src/flags.rsindex 36e363ca40c..145912fd704 100644--- a/crates/feature_flags/src/flags.rs+++ b/crates/feature_flags/src/flags.rs@@ -59,18 +59,6 @@ impl FeatureFlag for DiffReviewFeatureFlag {}register_feature_flag!(DiffReviewFeatureFlag);-pub struct UpdatePlanToolFeatureFlag;--impl FeatureFlag for UpdatePlanToolFeatureFlag {- const NAME: &'static str = "update-plan-tool";- type Value = PresenceFlag;-- fn enabled_for_staff() -> bool {- false- }-}-register_feature_flag!(UpdatePlanToolFeatureFlag);-/// Gates the `create_thread` and `list_agents_and_models` tools, which let/// the agent spawn independent sibling threads that show up in the agent/// panel sidebar.@@ -86,18 +74,6 @@ impl FeatureFlag for CreateThreadToolFeatureFlag {}register_feature_flag!(CreateThreadToolFeatureFlag);-pub struct UpdateTitleToolFeatureFlag;--impl FeatureFlag for UpdateTitleToolFeatureFlag {- const NAME: &'static str = "update-title-tool";- type Value = PresenceFlag;-- fn enabled_for_staff() -> bool {- false- }-}-register_feature_flag!(UpdateTitleToolFeatureFlag);-pub struct LspToolFeatureFlag;impl FeatureFlag for LspToolFeatureFlag {diff --git a/crates/settings_ui/src/pages/tool_permissions_setup.rs b/crates/settings_ui/src/pages/tool_permissions_setup.rsindex 8f010bc6b05..a19a3c2100f 100644--- a/crates/settings_ui/src/pages/tool_permissions_setup.rs+++ b/crates/settings_ui/src/pages/tool_permissions_setup.rs@@ -1422,12 +1422,6 @@ mod tests {// tool calls inside the spawned thread, not the spawning itself."create_thread","spawn_agent",- // update_plan updates UI-visible planning state but does not use- // tool permission rules.- "update_plan",- // update_title updates UI-visible session metadata but- // does not use tool permission rules.- "update_title",];let tool_info_ids: Vec<&str> = TOOLS.iter().map(|t| t.id).collect();