From 76c878ddc43e8a2db2192cbbd21115e1dda2e9db Mon Sep 17 00:00:00 2001 From: Ben Brandt Date: Sat, 21 Feb 2026 15:14:16 +0100 Subject: [PATCH] agent: More subagent wordsmithing (#49804) Now that this is also used for resuming, I think this is clearer what the input is. Release Notes: - N/A --- crates/agent/src/tests/mod.rs | 8 ++++---- crates/agent/src/tools/spawn_agent_tool.rs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/agent/src/tests/mod.rs b/crates/agent/src/tests/mod.rs index e1f45faf12f831729010dc7cbbada9596c395e5f..da5f5d2c8ec8b22d1412832a40a2d8f6ae4d9222 100644 --- a/crates/agent/src/tests/mod.rs +++ b/crates/agent/src/tests/mod.rs @@ -4232,7 +4232,7 @@ async fn test_subagent_tool_call_end_to_end(cx: &mut TestAppContext) { model.send_last_completion_stream_text_chunk("spawning subagent"); let subagent_tool_input = SpawnAgentToolInput { label: "label".to_string(), - task: "subagent task prompt".to_string(), + message: "subagent task prompt".to_string(), session_id: None, timeout_secs: None, }; @@ -4383,7 +4383,7 @@ async fn test_subagent_tool_call_cancellation_during_task_prompt(cx: &mut TestAp model.send_last_completion_stream_text_chunk("spawning subagent"); let subagent_tool_input = SpawnAgentToolInput { label: "label".to_string(), - task: "subagent task prompt".to_string(), + message: "subagent task prompt".to_string(), session_id: None, timeout_secs: None, }; @@ -4521,7 +4521,7 @@ async fn test_subagent_tool_resume_session(cx: &mut TestAppContext) { model.send_last_completion_stream_text_chunk("spawning subagent"); let subagent_tool_input = SpawnAgentToolInput { label: "initial task".to_string(), - task: "do the first task".to_string(), + message: "do the first task".to_string(), session_id: None, timeout_secs: None, }; @@ -4583,7 +4583,7 @@ async fn test_subagent_tool_resume_session(cx: &mut TestAppContext) { model.send_last_completion_stream_text_chunk("resuming subagent"); let resume_tool_input = SpawnAgentToolInput { label: "follow-up task".to_string(), - task: "do the follow-up task".to_string(), + message: "do the follow-up task".to_string(), session_id: Some(subagent_session_id.clone()), timeout_secs: None, }; diff --git a/crates/agent/src/tools/spawn_agent_tool.rs b/crates/agent/src/tools/spawn_agent_tool.rs index 72f01c8c16e55744b8cc96566d109ee39f41fb91..e194636bc6dff629627be290f22ecb6d148b2f2a 100644 --- a/crates/agent/src/tools/spawn_agent_tool.rs +++ b/crates/agent/src/tools/spawn_agent_tool.rs @@ -33,8 +33,8 @@ pub struct SpawnAgentToolInput { /// Short label displayed in the UI while the agent runs (e.g., "Researching alternatives") pub label: String, /// Describe the task for the agent to perform. Be specific about what you want accomplished. Include all necessary context (file paths, requirements, constraints) since the agent cannot see your conversation. - pub task: String, - /// Optional session ID of an existing agent session to continue a conversation with. When provided, the task is sent as a follow-up message to that session instead of creating a new one. Use this to ask clarifying questions, request changes based on previous output, or retry after errors. + pub message: String, + /// Optional session ID of an existing agent session to continue a conversation with. When provided, the message is sent as a follow-up to that session instead of creating a new one. Use this to ask clarifying questions, request changes based on previous output, or retry after errors. #[serde(default)] pub session_id: Option, /// Optional maximum runtime in seconds. The purpose of this timeout is to prevent the agent from getting stuck in infinite loops, NOT to estimate task duration. Be generous if setting. If not set, the agent runs until it completes or is cancelled. @@ -117,7 +117,7 @@ impl AgentTool for SpawnAgentTool { self.environment.resume_subagent( parent_thread_entity, session_id, - input.task, + input.message, input.timeout_secs.map(Duration::from_secs), cx, ) @@ -125,7 +125,7 @@ impl AgentTool for SpawnAgentTool { self.environment.create_subagent( parent_thread_entity, input.label, - input.task, + input.message, input.timeout_secs.map(Duration::from_secs), cx, )