Skip to content
Closed
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
18 changes: 16 additions & 2 deletions tools/delegate_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ def delegate_task(
context: Optional[str] = None,
toolsets: Optional[List[str]] = None,
tasks: Optional[List[Dict[str, Any]]] = None,
model: Optional[str] = None,
max_iterations: Optional[int] = None,
acp_command: Optional[str] = None,
acp_args: Optional[List[str]] = None,
Expand Down Expand Up @@ -558,7 +559,7 @@ def delegate_task(
if tasks and isinstance(tasks, list):
task_list = tasks[:MAX_CONCURRENT_CHILDREN]
elif goal and isinstance(goal, str) and goal.strip():
task_list = [{"goal": goal, "context": context, "toolsets": toolsets}]
task_list = [{"goal": goal, "context": context, "toolsets": toolsets, "model": model}]
else:
return tool_error("Provide either 'goal' (single task) or 'tasks' (batch).")

Expand Down Expand Up @@ -591,7 +592,7 @@ def delegate_task(
for i, t in enumerate(task_list):
child = _build_child_agent(
task_index=i, goal=t["goal"], context=t.get("context"),
toolsets=t.get("toolsets") or toolsets, model=creds["model"],
toolsets=t.get("toolsets") or toolsets, model=t.get("model") or creds["model"],
max_iterations=effective_max_iter, parent_agent=parent_agent,
override_provider=creds["provider"], override_base_url=creds["base_url"],
override_api_key=creds["api_key"],
Expand Down Expand Up @@ -908,6 +909,10 @@ def _load_config() -> dict:
"items": {"type": "string"},
"description": "Toolsets for this specific task. Use 'web' for network access, 'terminal' for shell.",
},
"model": {
"type": "string",
"description": "Per-task model override (e.g. 'modelstudio/qwen3-coder-plus'). Overrides the top-level model for this task only.",
},
"acp_command": {
"type": "string",
"description": "Per-task ACP command override (e.g. 'claude'). Overrides the top-level acp_command for this task only.",
Expand All @@ -934,6 +939,14 @@ def _load_config() -> dict:
"Only set lower for simple tasks."
),
},
"model": {
"type": "string",
"description": (
"Model override for subagent (e.g. 'modelstudio/qwen3-coder-plus'). "
"When set, the child uses this model instead of inheriting the parent's. "
"Use format: 'provider/model' or just 'model' if provider is the same."
),
},
"acp_command": {
"type": "string",
"description": (
Expand Down Expand Up @@ -969,6 +982,7 @@ def _load_config() -> dict:
context=args.get("context"),
toolsets=args.get("toolsets"),
tasks=args.get("tasks"),
model=args.get("model"),
max_iterations=args.get("max_iterations"),
acp_command=args.get("acp_command"),
acp_args=args.get("acp_args"),
Expand Down