Repository navigation
Allow specifying model and provider for spawn_agent
#60993
Replies: 4 comments 5 replies
|
Wouldn't this mean putting your full list of models in the context window for every request? That seems like a very bad idea. Allowing you to configure a small set of preset configs seems a lot more reasonable. I guess that's what you mean by this:
|
|
I have a lot of interest in such a feature! It would be extremely useful for orchestration. For example, having GLM-5.3-flash performing most of the work, and then spawning a GLM-5.3 sub-agent for code reviews or for a slice where you want to spend a bit more to ensure it gets done right. |
|
On-the-fly model selection for subagents has shipped in Zed Stable v1.22.0! The Thanks to @itsfuad for the implementation! |

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Body
What are you proposing?
Currently
spawn_agenteither uses the main thread model, or if set, whatever is set insubagent_model. This means that thespawn_agentmodel is either fixed to a specific model, or whatever the main thread currently uses. It's not possible to dynamically change this depending on the usecase.I want to propose adding a parameter to specifying provider and model, or the name of another profile (if we implement default models for profiles first, that would simplify the args) to the
spawn_agentcommand, so that a orchestrator model can dynamically decide which model to use for the specific agent.Current schema:
{ "required": ["label", "message"], "properties": { "label": { "description": "Short label displayed in the UI while the agent runs (e.g., \"Researching alternatives\")", "type": "string" }, "message": { "description": "The prompt for the agent. For new sessions, include full context needed for the task. For follow-ups (with session_id), you can rely on the agent already having the previous message.", "type": "string" }, "session_id": { "description": "Session ID of an existing agent session to continue instead of creating a new one.", "type": ["string", "null"], "default": null } }, "type": "object", "additionalProperties": false }Adding
model_providerandmodel_idfields:{ "name": "spawn_agent", "description": "Spawn a sub-agent for a well-scoped task.", "parameters": { "type": "object", "additionalProperties": false, "required": ["label", "message"], "properties": { "label": { "type": "string", "description": "Short label displayed in the UI while the agent runs (e.g., \"Researching alternatives\")" }, "message": { "type": "string", "description": "The prompt for the agent. For new sessions, include full context needed for the task. For follow-ups (with session_id), you can rely on the agent already having the previous message." }, "session_id": { "type": ["string", "null"], "default": null, "description": "Session ID of an existing agent session to continue instead of creating a new one." }, "model_provider": { "type": ["string", "null"], "default": null, "description": "Optional model provider for the spawned agent (e.g. \"anthropic\", \"openai\", \"google\"). If omitted or null, the host/agent default provider is used. On follow-ups (with session_id), ignore this field and keep the existing session model unless the host explicitly supports mid-session model switching." }, "model_id": { "type": ["string", "null"], "default": null, "description": "Optional model id within model_provider (e.g. \"claude-opus-4-6\"). If omitted or null, the default model for the selected provider (or the host default if provider is also null) is used. On follow-ups (with session_id), ignore this field and keep the existing session model unless the host explicitly supports mid-session model switching." } } } }Why does this matter?
Currently,
spawn_agentis pinned to a specific model, but without a way to do this case by case. I want to be able to tell the agent to usespawn_agentwithprovider=xxxandmodel=foo, orprofile=askso that, depending on the task, the agent can specify which model to use for this taskSo we could have a
code-reviewskill that uses Gemini 3.1 Pro, or aimplement-taskskill that usescomposer-2.5. Both cases would need vastly different.This would allow us to write detailed skills teaching the orchestrator model which model to delegate specific tasks to.
All reactions