Repository navigation
Support defining multiple named custom subagents with unique settings/prompts #59946
Replies: 2 comments 1 reply
# What are you proposing?Add an optional // Full delegation (today — unchanged)
{ "label": "refactor", "message": "..."}
// Restricted delegation (new — only these tools)
{ "label": "benchmark-search", "message": "Run the search benchmark...",
"tools": ["read_file", "grep", "find_path"] }
// Zero-tool subagent (new — pure reasoning, no tool access)
{ "label": "analyze-results", "message": "Analyze these benchmark results...",
"tools": [] }The list is validated to be a subset of the spawner's currently enabled tools. Invalid names return an error. The filter is a snapshot set at creation and does not change if the parent's tools change mid-turn. On session resume ( # Why does this matter?Subagents always inherit their spawner's full profile. This makes sense for "delegate everything," but breaks down for scoped delegation:
# Are there any examples or context?1. The sibling feature already ships. 2. The codebase already conditionally gates tools on subagent properties. 3. Per-thread non-profile state already exists. 4. The 5. The spawner already sees tool names in its system prompt. 6. The directly adjacent feature request — "show subagent model in UI" (#62077) — confirms that users want more visibility and control over per-subagent configuration. # Possible approachThe surface area is small.
No changes to Release Notes:
Originally posted by @Prohect in #62143. |
|
add an optional workspace tool parameter that can be used to specify the paths (dirs) the sub-agent can interact with. |
Uh oh!
There was an error while loading. Please reload this page.
Body
What are you proposing?
Introduce a subagents configuration block in settings.json that supports declaring multiple, named subagent profiles. The orchestrating parent agent should be able to see these profiles as available targets or tools when invoking spawn_agent.
Why does this matter?
Context Efficiency: It stops subagents from over-consuming expensive tokens on minor tasks by routing them to tailored, smaller models.Task Accuracy: Providing strict role boundaries (e.g., separating a "tester" from a "writer") improves the final code output drastically compared to a single generic prompt.Agentic Workflows: This aligns perfectly with Zed's new multi-agent push, allowing actual team-like specialization right inside the editor.
What problem does this solve?
Currently, Zed's spawn_agent mechanism is a monolithic "black box." Subagents are generic and cannot be configured with distinct roles or rules. They either inherit the parent thread's model or fallback globally to the singular subagent_model setting.If I want one subagent to handle highly optimized code refactoring via an expensive reasoning model, and a second subagent to quickly generate documentation using a cheaper, faster model, it is currently impossible. Zed restricts users to a single, one-size-fits-all subagent behavior.
What becomes easier or possible?
Users gain the ability to orchestrate complex, multi-step engineering tasks inside the Agent Panel without changing global settings mid-workflow.For example, a user can ask the main assistant to review a file. The main assistant can then concurrently spawn a unit_tester subagent to write tests, and a docs_expert subagent to update the markdown documentation. Each subagent operates within its own tight context window, using optimal models and optimized system instructions.
Are there any examples or context?
{
"agent": {
"default_model": {
"provider": "anthropic",
"model": "claude-3-5-sonnet"
},
"subagents": {
"code_refactorer": {
"model": "claude-3-5-sonnet",
"system_instruction": "You are a rigid refactoring engine. Only output clean, DRY code without conversational filler.",
"temperature": 0.2
},
"unit_tester": {
"model": "gpt-4o-mini",
"system_instruction": "Generate comprehensive unit tests using Vitest. Include edge cases.",
"allowed_tools": ["read_file", "write_file"]
},
"docs_expert": {
"model": "gemini-1.5-flash",
"system_instruction": "Format all output in strict JSDoc syntax following Google style guides."
}
}
}
}
Screenshots, mockups, workflows, or examples from other tools.
User asks Main Agent: "Refactor this module, write tests for it, and document the changes."Main Agent calls tool: spawn_agent(profile="code_refactorer", task="...")Main Agent calls tool: spawn_agent(profile="unit_tester", task="...")Main Agent calls tool: spawn_agent(profile="docs_expert", task="...")
Possible approach
Schema Update: Expand the agent settings schema to accept a subagents object containing user-defined keys (the profile names).Tool Parameter Extension: Modify the internal spawn_agent tool definition so that it accepts a profile parameter matching one of the keys in settings.json.Context Injection: When spawn_agent runs with a specified profile, it should initialize the sub-session by injecting that profile's specific system_instruction and overrides instead of inheriting the global defaults.
All reactions