Skip to content

Builtin anthropic provider rejects valid model IDs (e.g. claude-opus-4-6) #21019

Closed as not planned

Description

@xu75

Problem

When using the builtin anthropic provider with -m anthropic/claude-opus-4-6, opencode returns:

Model not found: claude-opus-4-6/

The builtin anthropic provider appears to maintain a hardcoded list of known models. When a newer Anthropic model (like claude-opus-4-6) is released, opencode rejects it until the model list is updated in a new release.

Expected Behavior

The builtin anthropic provider should accept arbitrary model IDs and forward them to the Anthropic API as-is. The API itself will validate whether the model exists — there's no need for client-side model validation that goes stale.

Steps to Reproduce

opencode run "hello" -m anthropic/claude-opus-4-6 --format json

Returns: Model not found: claude-opus-4-6/

Environment

  • opencode version: 1.3.7 (also reproduced on 1.3.13)
  • OS: macOS (Darwin 25.3.0)
  • Node: v22.17.0
  • Installed via: npm install -g opencode-ai

Suggested Fix

For builtin providers, allow pass-through of unknown model IDs to the upstream API rather than rejecting them client-side. This would make opencode forward-compatible with new model releases without requiring a version bump.

Alternatively, if client-side validation is desired, provide a config option or flag to bypass it (e.g. --allow-unknown-model).

Workaround

We currently work around this by generating a runtime config file (opencode.json) with an explicit models map that registers the model, and passing it via OPENCODE_CONFIG env var. This bypasses the builtin provider's model validation.

Activity

  1. added
    core
    on Apr 4, 2026
  2. github-actions commented on Apr 4, 2026

    @github-actions
    Contributor

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

    If your issue is specifically about the builtin Anthropic provider rejecting valid model IDs, it may be worth linking to or commenting on those issues rather than filing separately.

  3. removed
    core
    on May 3, 2026
  4. github-actions commented on Jul 3, 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