anomalyco / anomalyco/opencode

[FEATURE]: Add a native V2 replacement for provider model filtering

Open
#49,986 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

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

Describe the enhancement

OpenCode V1 supports per-provider model filtering with whitelist and blacklist:

{
  "provider": {
    "ollama-cloud": {
      "whitelist": ["glm-5.2"]
    }
  }
}

This is useful when a provider exposes a large or changing catalog.

V2 currently drops these fields during V1-to-V2 normalization. The provider remains available, but the model filter is not applied.

Reproduction

Tested with @opencode/cli@2.0.9 using a clean config and:

npx --yes @opencode/cli@2.0.9 \
  api --standalone --print-logs get /api/config

The normalized config contains the provider settings but omits whitelist. The server log reports:

path=$.provider.ollama-cloud.whitelist
kind=unsupported
action="omitted unsupported legacy setting"

Expected behavior

Please either:

  1. provide a native V2 equivalent for per-provider model filtering; or
  2. document the intentional removal and recommended replacement clearly in the V2 migration guide.

The old provider documentation still documents this feature, which makes migration unclear.

References

Related: #42535 covers wildcard support for the existing V1 filter syntax. This issue concerns the missing V2 migration path.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with packages/core/src/config/normalize.ts around the V1-to-V2 provider normalization and unsupported-field handling, then compare the linked V1 provider implementation and V2 provider and migration documentation. Confirm how provider model filtering should work in V2; done means the behavior is supported natively or its removal and replacement are clearly documented, with coverage for the reported normalization case.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ai, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.