You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add an optional `model` parameter to the task tool (provider/model format)
that overrides the subagent's model, gated behind a new `model_override`
permission that defaults to deny. Selection precedence is the `model`
parameter, then the subagent's configured model, then the parent assistant
message model.
Ported from anomalyco#29447 (adapted for the Effect layer).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
description: Schema.String.annotate({description: "A short (3-5 words) description of the task"}),
45
47
prompt: Schema.String.annotate({description: "The task for the agent to perform"}),
46
48
subagent_type: Schema.String.annotate({description: "The type of specialized agent to use for this task"}),
49
+
model: Schema.optional(Schema.String).annotate({
50
+
description:
51
+
"Override the model for this subagent. Format: provider/model (e.g. anthropic/claude-sonnet-4, openai/gpt-4o). Takes precedence over the agent's configured model.",
"This should only be set if you mean to resume a previous task (you can pass a prior task_id and the task will continue the same subagent session as before instead of creating a fresh one)",
Copy file name to clipboardExpand all lines: packages/opencode/src/tool/task.txt
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,12 @@ When NOT to use the Task tool:
8
8
- If you are searching for code within a specific file or set of 2-3 files, use the Read tool instead of the Task tool, to find the match more quickly
9
9
- If no available agent is a good fit for the task, use other tools directly
10
10
11
+
Model selection:
12
+
- Each agent has a default model (usually inherited from the parent session).
13
+
- You can override the model by passing the `model` parameter in `provider/model` format (e.g. `anthropic/claude-sonnet-4`, `openai/gpt-4o`, `google/gemini-2.5-pro`).
14
+
- Model overrides require the `model_override` permission. By default this permission is denied. The user can allow specific models or providers in their config (e.g. `"model_override": { "anthropic/*": "allow" }`).
15
+
- Model selection precedence is `model` parameter, then the subagent's configured model, then the parent assistant message model.
16
+
11
17
12
18
Usage notes:
13
19
1. Launch multiple agents concurrently whenever possible, to maximize performance; to do that, use a single message with multiple tool uses
"description": "A short (3-5 words) description of the task",
314
314
"type": "string",
315
315
},
316
+
"model": {
317
+
"description": "Override the model for this subagent. Format: provider/model (e.g. anthropic/claude-sonnet-4, openai/gpt-4o). Takes precedence over the agent's configured model.",
318
+
"type": "string",
319
+
},
316
320
"prompt": {
317
321
"description": "The task for the agent to perform",
0 commit comments