Problem
delegate_task() has no way to specify which model/provider a subagent should use — neither at the top level (single task mode) nor per-task (batch mode). Subagents always inherit the parent agent model or fall back to delegation config, making it impossible to:
- Route cheap mechanical subtasks to a fast/cheap model
- Use a vision-capable model for a specific subagent
- Point a subagent at a completely different provider/endpoint
Five open issues track this gap from various angles: #5012, #10995, #17685, #23467, #32711.
Desired API
Add optional parameters to both the top-level delegate_task() and individual tasks[] items.
Top-level (applies to all subagents unless overridden per-task)
provider (str, optional) — provider name (e.g. "openrouter", "anthropic", or "custom:")
model (str, optional) — model name (e.g. "qwen/qwen-turbo", "claude-sonnet-4")
base_url (str, optional) — override the API endpoint base URL
api_format (str, optional) — "openai" | "anthropic" | "codex" etc. (maps to internal api_mode)
api_key (str, optional) — API key for the target provider
Per-task (overrides top-level for that specific child)
Each item in tasks[] should also accept the same fields: provider, model, base_url, api_format, api_key.
Why this is feasible
The internal _build_child_agent() (line 870 in tools/delegate_tool.py) already supports override_provider, override_base_url, override_api_key, override_api_mode — but these are only populated from delegation config in config.yaml. The gap is purely in the tool schema and the handler wiring: the parameters exist in the builder, they just aren't exposed to the model via delegate_task().
Implementation sketch
- Add
provider/model/base_url/api_format/api_key to DELEGATE_TASK_SCHEMA (both top-level properties and tasks.items.properties)
- Add corresponding parameters to
delegate_task() function signature
- Thread them through the handler into
_build_child_agent() override params
- For
api_format, map to the internal api_mode string (the builder already takes override_api_mode)
Related issues (all should be closed by this unified implementation)
Problem
delegate_task()has no way to specify which model/provider a subagent should use — neither at the top level (single task mode) nor per-task (batch mode). Subagents always inherit the parent agent model or fall back todelegationconfig, making it impossible to:Five open issues track this gap from various angles: #5012, #10995, #17685, #23467, #32711.
Desired API
Add optional parameters to both the top-level
delegate_task()and individualtasks[]items.Top-level (applies to all subagents unless overridden per-task)
provider(str, optional) — provider name (e.g. "openrouter", "anthropic", or "custom:")model(str, optional) — model name (e.g. "qwen/qwen-turbo", "claude-sonnet-4")base_url(str, optional) — override the API endpoint base URLapi_format(str, optional) — "openai" | "anthropic" | "codex" etc. (maps to internalapi_mode)api_key(str, optional) — API key for the target providerPer-task (overrides top-level for that specific child)
Each item in
tasks[]should also accept the same fields:provider,model,base_url,api_format,api_key.Why this is feasible
The internal
_build_child_agent()(line 870 intools/delegate_tool.py) already supportsoverride_provider,override_base_url,override_api_key,override_api_mode— but these are only populated fromdelegationconfig inconfig.yaml. The gap is purely in the tool schema and the handler wiring: the parameters exist in the builder, they just aren't exposed to the model viadelegate_task().Implementation sketch
provider/model/base_url/api_format/api_keytoDELEGATE_TASK_SCHEMA(both top-levelpropertiesandtasks.items.properties)delegate_task()function signature_build_child_agent()override paramsapi_format, map to the internalapi_modestring (the builder already takesoverride_api_mode)Related issues (all should be closed by this unified implementation)