GeezerVison is showing github.com — feat(opencode): add model parameter to task tool for subagent model override by funkybooboo · Pull Request #26535 · anomalyco/opencode
feat(opencode): add model parameter to task tool for subagent model override
#26535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
description: Schema.String.annotate({ description: "A short (3-5 words) description of the task" }),
prompt: Schema.String.annotate({ description: "The task for the agent to perform" }),
subagent_type: Schema.String.annotate({ description: "The type of specialized agent to use for this task" }),
model: Schema.optional(Schema.String).annotate({
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.",
"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)",
- 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
- Other tasks that are not related to the agent descriptions above
Model selection:
- Each agent has a default model (usually inherited from the parent session).
- 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`).
- Model overrides require the `model_override` permission. By default this permission is denied and the user will be asked to approve. The user can allow specific models or providers in their config (e.g. `"model_override": { "anthropic/*": "allow" }`).
- Use the `model` parameter to run a subagent on a different model than the parent session. This is useful for leveraging different model strengths (e.g., sending research tasks to a faster/cheaper model, or routing code generation to a more capable model).
Usage notes:
1. Launch multiple agents concurrently whenever possible, to maximize performance; to do that, use a single message with multiple tool uses
expect(result.metadata.model.providerID as string).toBe("anthropic")
expect(result.metadata.model.modelID as string).toBe("claude-sonnet-4")
expect((seen?.model?.providerID ?? "") as string).toBe("anthropic")
expect((seen?.model?.modelID ?? "") as string).toBe("claude-sonnet-4")
}),
)
})
Loading
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.