Skip to content

[FEATURE]: Allow agent-level model pools and fallback policies #16868

Closed as not planned

Description

@young5lee

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

  • I have searched existing issues and could not find the same request.
  • This is a feature request, not a bug report.
  • I am opening this issue first for design discussion before any PR.

Problem

Current configuration appears centered on a single model per global/agent setting.

That makes it hard to express practical policies like:

  • use a cheap/fast model first, then fall back to a stronger one
  • use provider A first, but switch to provider B on rate limit or outage
  • give lightweight agents one pool and coding agents another pool

Proposed solution

Please consider allowing agent-level model pools and fallback policies.

Possible shapes:

  • primary + fallbacks
  • or ordered models[]

Possible policy fields:

  • fallback_on: [rate_limit, timeout, provider_unavailable, token_limit]
  • strategy: sequential
  • optionally later: round_robin, cost_first, quality_first

Example behavior

For an agent:

  • primary: google/gemini-2.5-flash
  • fallback 1: anthropic/claude-haiku-4.5
  • fallback 2: openai/gpt-5-mini

If the primary model fails with a configured runtime condition, OpenCode tries the next model in order.

Why this fits OpenCode

This seems like a natural extension of the project’s provider-agnostic design. It would make cost/speed/reliability tradeoffs easier to express without manual switching.

Backward compatibility

Single-model config should continue to work exactly as it does today.

Additional context

This would become even more useful if combined with:

  • multiple auth profiles per provider
  • cooldown-aware runtime failover

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Mar 10, 2026
  2. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 10, 2026
  3. github-actions commented on Mar 10, 2026

    @github-actions
    Contributor

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

    Additionally, the cooldown-aware failover aspect of this request overlaps closely with #16867, which was filed by the same author.

  4. assigned and unassigned on Apr 26, 2026
  5. removed
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  6. github-actions commented on Jul 4, 2026

    @github-actions
    Contributor

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

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