Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Two modes for action='spawn':
The two modes are mutually exclusive: do not provide `subagent_type` when `fork_context=true`.
1. With an explicit `subagent_type` (default)
- Provide `agent_id`, `subagent_type`, and `prompt`.
- Available types and names are listed in the <available_agents> section. Users reference agents by name; match their requested name to this catalog and pass the corresponding internal type. If a name is ambiguous, ask which agent they mean instead of choosing one. Refer to agents by name when talking to the user; do not ask users to provide internal types. Each type has specific capabilities and tools.
- The <available_agents> section lists the allowed agent types and their capabilities. Pass the exact `type` value from that catalog as `subagent_type`.
- In this mode, the subagent does not share your context. Include all necessary background information in the prompt.
2. By forking the current context
- Set `fork_context=true`, and provide `agent_id` and `prompt`. Do not provide `subagent_type`.
Expand Down Expand Up @@ -162,7 +162,7 @@ impl AgentSpawnTool {
pub(super) fn render_agent_spawn_description(&self) -> String {
r#"Launch a new agent to work independently in the background.

Choose an `agent_type` permitted by the current system prompt. The <available_agents> catalog includes each agent's name and internal type. Users reference agents by name; match their requested name to this catalog and pass the corresponding internal type as `agent_type`. If a name matches multiple agents, ask for clarification instead of choosing one. Refer to agents by name when talking to the user; do not ask users to provide internal types. Each type has its own role and tool set.
Choose an `agent_type` permitted by the current system prompt. Pass the exact `type` value from the <available_agents> catalog. Each type has its own role and tool set.

Choose a meaningful `agent_id` for this agent. It must be unique among agents launched by you and match `[a-z][a-z0-9_-]{0,31}`.

Expand All @@ -172,11 +172,15 @@ Write a self-contained `prompt` that gives the agent everything it needs to comp
- Pass precise references instead of pasting large file contents.
- Keep the prompt under 180 lines / 16KB when practical; split broad work into focused agents with clear ownership.

The agent shares the current workspace and starts with a fresh conversation. The result includes a `bg_task_id`. Use `bg_task_id` with AgentWait to collect the result. For agents that support follow-up turns, use the requested `agent_id` with AgentSendInput; use AgentControl with `action="interrupt"` to stop active work or `action="delete"` to remove an agent subtree.
The agent shares your workspace. If the task targets a different workspace, explicitly include the path in the prompt.

The agent starts with a fresh conversation, and does not inherit your conversation history.

Set `model_id` only when a particular model is required. Omit it to use the agent's configured model. `inherit` selects the current model; `primary` and `fast` select the corresponding configured model slots. Call ListModels before using a configured model ID.

Independent agents can be launched together when that improves coverage or latency. Give agents that may write files non-overlapping scopes so their edits and side effects do not conflict."#
Independent agents can be launched together when that improves coverage or latency. Give agents that may write files non-overlapping scopes so their edits and side effects do not conflict.

The result includes a `bg_task_id`. Use `bg_task_id` with AgentWait to collect the result. For agents that support follow-up turns, use the requested `agent_id` with AgentSendInput; use AgentControl with `action="interrupt"` to stop active work or `action="delete"` to remove an agent subtree."#
.to_string()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,6 @@ fn named_agent(id: &str, name: &str) -> crate::agentic::agents::AgentInfo {
.expect("legacy catalog entry should deserialize")
}

#[test]
fn agent_name_reference_catalog_exposes_the_display_name_and_escapes_markup() {
let available = vec![named_agent("agent-internal", "Research & <review>")];
let listing = AgentExecutionTool::format_agent_descriptions(&available);
assert!(listing.contains("<agent type=\"agent-internal\">"));
assert!(listing.contains("<name>Research &amp; &lt;review&gt;</name>"));
assert!(listing.contains("<tools>Read</tools>"));
assert!(AgentSpawnTool
.render_agent_spawn_description()
.contains("Users reference agents by name"));
}

#[test]
fn external_subagent_validation_accepts_model_emitted_casing() {
let available = vec!["FileFinder".to_string(), "explore".to_string()];
Expand Down
Loading