GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [FEATURE]: Runtime model override for task tool subagents · Issue #17595 · anomalyco/opencode

[FEATURE]: Runtime model override for task tool subagents #17595

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
[FEATURE]: Runtime model override for task tool subagents#17595
Copy link
Assignees
rekram1-node

Description

@Quadina
Quadina
opened on Mar 15, 2026
Issue body actions

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

Problem: Subagents always run on the model configured at startup. There's no way for an orchestrating agent to switch models at runtime based on context.

Use cases:

  1. Adaptive review loop — orchestrator runs code review on haiku. If the same errors repeat twice, it escalates to sonnet or opus for a more thorough review (fewer false positives, better understanding of context).
  2. Variable-complexity reports — same report-generating subagent, but the orchestrator picks the model based on report difficulty. Simple report → cheap model. Complex/long report → stronger model. The agent definition stays the same.

Proposed approach: Add a model parameter to the task tool ("provider/model-id" format). Gate it with a new model_override permission (default: deny) so users control which models agents can switch to. Supports wildcards ("anthropic/*": "allow") and specific models.

Why permission-gated: Without it, a prompt injection could escalate to an expensive model, or an agent could pick models randomly. The permission system lets users whitelist exactly what's allowed.

Not a duplicate of #17570: That issue is about static config — users assign models to subagents upfront in config/UI. This is about runtime decisions — the orchestrating agent picks the model dynamically based on what's happening during execution (errors, complexity, retries). They're complementary features.


Note: PR #17577 with an implementation already exists — apologies for the reversed order. Opening this issue retroactively for proper tracking and design discussion.

Reacted by Duong M. CUONG, taurasbear and Umesh

Activity

  1. github-actions
    assigned
    thdxr
    on Mar 15, 2026
  2. github-actions
    added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 15, 2026
  3. github-actions commented on Mar 15, 2026

    @github-actions
    github-actionsBot
    on Mar 15, 2026 – with GitHub Actions
    Contributor
    More actions

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

    • [FEATURE]: Dynamic model selection for subagents via Task tool #6651: Requests dynamic/runtime model selection for subagents via the Task tool — same core concept of an orchestrating agent picking the model per invocation based on task complexity
    • [FEATURE]: @agent:provider/model syntax to override subagent model on the fly #11215: Requests per-invocation model override for subagents (@agent:provider/model syntax) — same goal of switching models at runtime without static config

    If your request adds meaningfully different scope (e.g., the permission-gating mechanism or the specific runtime-escalation use cases), please clarify how it differs so maintainers can decide whether to merge or keep separate.

  4. thdxr
    assigned
    rekram1-node
    and unassigned
    thdxr
    on Apr 26, 2026
  5. thdxr
    removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  6. funkybooboo
    added a commit that references this issue on May 9, 2026

    feat(opencode): add model parameter to task tool for subagent model o…

    This issue will close once commit bf6215a is merged into the 'dev' branch.
    bf6215a
  7. funkybooboo commented on May 9, 2026

    @funkybooboo
    funkybooboo
    on May 9, 2026
    More actions

    I've opened PR #26535 implementing this feature with a minimal, permission-gated approach:

    • Adds an optional model parameter to the task tool (provider/model format)
    • model_override permission denied by default -- users opt in via config (e.g. "model_override": { "anthropic/*": "allow" })
    • Validates provider/model format with clear error messages
    • Model priority: params.model -> agent.model -> parent session model

    This is similar to #18528 but uses Effect Schema instead of zod and inlines the parsing to avoid importing the heavy Provider module. Compared to #11217 (UI-driven @agent:provider/model) and #11377 (tier abstraction), this takes the simplest direct approach with the security gate from the original issue.

  8. github-actions commented on Jul 9, 2026

    @github-actions
    github-actionsBot
    on Jul 9, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  9. github-actions
    closed this as not plannedon Jul 9, 2026
  10. Doble-K commented on Aug 7, 2026

    @Doble-K
    Doble-K
    on Aug 7, 2026
    More actions

    I ran into this issue while building an orchestration framework on top of OpenCode and wanted to share what I found after tracing the implementation.

    Initially I assumed this was a bug because I was requesting a Medium model for a delegated Worker task, but the Worker was executing with MiMo.

    After inspecting the framework, I realized the behavior was actually expected:

    • Agent-configured models are propagated correctly.
    • SubtaskPart.model is supported.
    • The HTTP Prompt API supports explicit model selection.
    • The Task tool itself does not expose a runtime model parameter, so there is no supported per-invocation override.

    The real problem in my framework turned out to be that the Director was still delegating to the generic worker alias instead of worker-medium. Since worker was configured with MiMo, the runtime was behaving correctly.

    Changing the delegation to explicit capability-based agents (worker-small, worker-medium, worker-large) solved the problem without any changes to OpenCode.

    So I can confirm that this is not a runtime bug—the current implementation is internally consistent.

    Although I still think a runtime model override could simplify orchestration frameworks by reducing duplicated agent definitions, the current capability-based approach works well once the routing is configured correctly.

    Hopefully this investigation helps anyone who arrives here after assuming the model selection is being ignored, as I initially did.

  11. RajatGarga commented on Aug 22, 2026

    @RajatGarga
    RajatGarga
    on Aug 22, 2026
    More actions

    I have hit a stone wall on this. I want to use opencode as my primary harness and hoped that this feature would ship but all I see is dead discussions closed automatically. Some with PRs as well

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

Metadata

Metadata

Assignees

  • @rekram1-node
    rekram1-node

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

    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.