Skip to content

[FEATURE]:Possibility for choosing the model for the subagents #46122

Closed

Description

@ghassenTn

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

if possible to add ability to choose a second model for the subagents and the codebase analysis agent

Activity

  1. github-actions commented on Aug 29, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. CloudyRiver9 commented on Sep 1, 2026

    @CloudyRiver9

    I've hit this exact need with a multi-model agent cluster. Some empirical findings that might help:

    1. Runtime config changes don't take effect: modifying agents/*.md model frontmatter while opencode is running does not affect new subagent sessions (verified via the session table's model field) — config is loaded at startup.
    2. The plumbing already exists: in packages/opencode/src/tool/task.ts the model resolution chain (agent model first, falling back to the parent message model) is already there, and the underlying PromptInput already accepts an optional model — only the task tool's Parameters schema is missing an optional model field. A minimal patch is ~15 lines.
    3. Use case: cost-tiered agents — a cheap flash worker by default, with per-task override to a stronger reasoning model for critical paths, without duplicating agent definitions per model tier.

    I'd be happy to open a PR for the minimal patch if maintainers are interested in this direction.

  3. neriousy commented on Oct 20, 2026

    @neriousy
    Member

    Thanks for the suggestion — OpenCode 2.0.5 added the ability to choose a model for individual subagent tasks, including codebase exploration. Ask OpenCode to use a particular model for the subagent, or set a default with "agents": { "explore": { "model": "provider/model" } } in your opencode.json, replacing provider/model with a model from one of your providers. Update with opencode upgrade or npm i -g @opencode/cli@latest (desktop: update the app). Please reopen or comment if this still doesn't work on that version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions