History

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

Ben Brandt committed 8 months ago

Commit 76c878d1 parent c22eaa72 files · +8 −8Browse files

Unified · Split

2 files
  1. crates/agent/src/tests/mod.rs +4 −4
  2. crates/agent/src/tools/spawn_agent_tool.rs +4 −4
crates/agent/src/tests/mod.rs+4−4
@@ -4232,7 +4232,7 @@ async fn test_subagent_tool_call_end_to_end(cx: &mut TestAppContext) { · 4231 unmodified lines
42324232 model.send_last_completion_stream_text_chunk("spawning subagent");
42334233 let subagent_tool_input = SpawnAgentToolInput {
42344234 label: "label".to_string(),
4235− task: "subagent task prompt".to_string(),
4235+ message: "subagent task prompt".to_string(),
42364236 session_id: None,
42374237 timeout_secs: None,
42384238 };
@@ -4383,7 +4383,7 @@ async fn test_subagent_tool_call_cancellation_during_task_prompt(cx: &mut TestAp · 144 unmodified lines
43834383 model.send_last_completion_stream_text_chunk("spawning subagent");
43844384 let subagent_tool_input = SpawnAgentToolInput {
43854385 label: "label".to_string(),
4386− task: "subagent task prompt".to_string(),
4386+ message: "subagent task prompt".to_string(),
43874387 session_id: None,
43884388 timeout_secs: None,
43894389 };
@@ -4521,7 +4521,7 @@ async fn test_subagent_tool_resume_session(cx: &mut TestAppContext) { · 131 unmodified lines
45214521 model.send_last_completion_stream_text_chunk("spawning subagent");
45224522 let subagent_tool_input = SpawnAgentToolInput {
45234523 label: "initial task".to_string(),
4524− task: "do the first task".to_string(),
4524+ message: "do the first task".to_string(),
45254525 session_id: None,
45264526 timeout_secs: None,
45274527 };
@@ -4583,7 +4583,7 @@ async fn test_subagent_tool_resume_session(cx: &mut TestAppContext) { · 55 unmodified lines
45834583 model.send_last_completion_stream_text_chunk("resuming subagent");
45844584 let resume_tool_input = SpawnAgentToolInput {
45854585 label: "follow-up task".to_string(),
4586− task: "do the follow-up task".to_string(),
4586+ message: "do the follow-up task".to_string(),
45874587 session_id: Some(subagent_session_id.clone()),
45884588 timeout_secs: None,
45894589 };
crates/agent/src/tools/spawn_agent_tool.rs+4−4
@@ -33,8 +33,8 @@ pub struct SpawnAgentToolInput { · 32 unmodified lines
3333 /// Short label displayed in the UI while the agent runs (e.g., "Researching alternatives")
3434 pub label: String,
3535 /// 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.
36− pub task: String,
37− /// 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.
36+ pub message: String,
37+ /// 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.
3838 #[serde(default)]
3939 pub session_id: Option<acp::SessionId>,
4040 /// 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 { · 76 unmodified lines
117117 self.environment.resume_subagent(
118118 parent_thread_entity,
119119 session_id,
120− input.task,
120+ input.message,
121121 input.timeout_secs.map(Duration::from_secs),
122122 cx,
123123 )
@@ -125,7 +125,7 @@ impl AgentTool for SpawnAgentTool { · 1 unmodified line
125125 self.environment.create_subagent(
126126 parent_thread_entity,
127127 input.label,
128− input.task,
128+ input.message,
129129 input.timeout_secs.map(Duration::from_secs),
130130 cx,
131131 )

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t