Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions src/crates/core/src/agentic/tools/implementations/task_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,25 @@ impl TaskTool {
}

fn format_agent_descriptions(&self, agents: &[AgentInfo]) -> String {
agents
.iter()
.map(|agent| {
format!(
"- {}: {} (Tools: {})",
agent.id,
agent.description,
agent.default_tools.join(", ")
)
})
.collect::<Vec<String>>()
.join("\n")
if agents.is_empty() {
return String::new();
}
let mut out = String::from("<available_agents>\n");
for agent in agents {
out.push_str(&format!(
"<agent type=\"{}\">\n<description>\n{}\n</description>\n<tools>{}</tools>\n</agent>\n",
agent.id,
agent.description,
agent.default_tools.join(", ")
));
}
out.push_str("</available_agents>");
out
}

fn render_description(&self, agent_descriptions: String) -> String {
let agent_descriptions = if agent_descriptions.is_empty() {
"- No enabled subagents found".to_string()
"<agents>No agents available</agents>".to_string()
} else {
agent_descriptions
};
Expand All @@ -44,7 +46,7 @@ impl TaskTool {

The Task tool launches specialized agents (subprocesses) that autonomously handle complex tasks. Each agent type has specific capabilities and tools available to it.

Available agent types and the tools they have access to:
Available agents and the tools they have access to:
{}

When using the Task tool, you must specify a subagent_type parameter to select which agent type to use.
Expand Down
Loading