anomalyco / anomalyco/opencode

V2: Reconcile provider catalogs with /models endpoints

Open
#40,524 3 comments 0 reactions 1 assignee View on GitHub

@rekram1-node is already working on this.

Since Aug 4, 2026.

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

Description

Problem

V2 should reconcile each provider's model catalog with the provider's /models endpoint instead of relying only on a static or stale catalog.

Today this can fail in both directions:

  • models exposed by the provider may be missing from OpenCode
  • models no longer exposed or usable by the provider may remain selectable

That leaves new models unavailable and stale or irrelevant models visible until hardcoded metadata catches up.

Desired behavior

  • Fetch model availability from supported providers' /models endpoints.
  • Merge endpoint results with OpenCode metadata needed for capabilities, limits, variants, and display names.
  • Drop models that the authoritative endpoint does not expose or marks unavailable for the current account or organization.
  • Preserve explicitly configured custom models where appropriate.
  • Define fallback behavior when discovery is unsupported, unauthenticated, malformed, or temporarily unavailable.
  • Refresh without making startup or model selection depend indefinitely on a slow provider.

Acceptance criteria

  • A newly exposed provider model becomes selectable without a static catalog update when the endpoint supplies enough information.
  • A model removed from the endpoint is no longer offered unless explicitly configured or covered by a documented fallback.
  • Account- or organization-scoped model lists are respected.
  • Endpoint failures retain a usable bounded fallback and surface diagnostics without silently replacing a known-good catalog with an empty list.
  • Tests cover additions, removals, explicit overrides, scoped availability, malformed responses, and request failure/timeout.

Related scope

This is broader than generic OpenAI-compatible custom-provider discovery: it covers V2's model-catalog reconciliation and filtering semantics across providers that expose authoritative model-list endpoints.

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.