anomalyco / anomalyco/opencode

bug: config provider-level npm override dropped for inherited models

Open
#41,162 1 comment 0 reactions 1 assignee View on GitHub

@nexxeln is already working on this.

Since Aug 8, 2026.

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

Description

Problem

A config-level npm override for an existing provider (e.g. provider.synthetic.npm = "@ai-sdk/anthropic") is silently dropped for models inherited from models.dev. The config-merge parsed object in provider.ts never carries npm, and apiNpm is only recomputed for models explicitly declared in config.

Impact: inherited models keep their models.dev api.npm, so the request uses the overridden options.baseURL with the original SDK — producing mismatched SDK+URL 404s. Concrete failure: with provider.synthetic.npm = "@ai-sdk/anthropic" + options.baseURL = ".../anthropic/v1", opencode POSTs /chat/completions (openai-compatible SDK) to an Anthropic-compatible base URL → 404 API route not found.

Expected behavior

A provider-level npm in config should propagate to all inherited models (those not explicitly declared in provider.models), so the SDK matches the overridden endpoint.

Environment

  • opencode version: 1.18.14+ (reproducible on dev)
  • Platform: Windows x64 (endpoint-agnostic)

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.