Skip to content

[FEATURE]: Native task routing over resolved models with reasoning-variant selection #51972

Description

@Melivo

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

OpenCode could natively support task-aware routing across the models it has already resolved, followed by compatible reasoning-variant selection.

I maintain a plugin that demonstrates this workflow: it makes two decisions for each request:

  1. Select an eligible agent/model for the task.
  2. Select a reasoning variant supported by that model (none, low, medium, high, xhigh, or max, depending on the runtime catalog).

The plugin validates the choice against the runtime model catalog and falls back without sending an unsupported variant. See the example implementation and configuration:

https://github.com/Melivo/opencode-plugin-variantizer

This is related to #34370, #8456, #50729, and #49712, but the useful native primitive here is the two-stage, catalog-aware decision: resolve the available models first, then derive the valid thinking/variant choices for the selected model. That would avoid plugins having to recreate model/variant discovery and would make the behavior consistent across TUI, CLI, and other clients.

Suggested behavior

  • Resolve the currently available and authorized model catalog.
  • Choose a model/agent based on the task, unless the user explicitly pinned one.
  • Choose a reasoning variant only from the selected model's resolved capabilities.
  • Preserve explicit user model and variant selections over automatic routing.
  • Validate the final model-plus-variant pair before the provider request; use a deterministic fallback when automatic classification is unavailable or invalid.
  • Expose the effective model and variant in session metadata or logs so the decision is inspectable.

The classification mechanism could be built in or exposed as a stable native extension point. The core should own catalog resolution, precedence, validation, and safe fallback behavior.

Acceptance criteria

  • No unsupported variant is sent to a provider because of automatic routing.
  • A user-pinned model or variant is never silently replaced.
  • Automatic routing works consistently for interactive and one-shot requests without requiring abort-and-resend.
  • The effective model, variant, and fallback outcome are observable for debugging.

Activity

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