Skip to content

feat(providers): make model discovery remote-first #1571

Closed

Description

@Astro-Han

Problem

Maka currently registers 14 ready remote providers with modelDiscovery: { kind: 'fallback' }.

For these providers, fetchProviderModels immediately returns the bundled fallback list without contacting the provider. The Desktop also hides the model-refresh action. As a result, a valid API key cannot discover newly added, removed, or account-specific models, and bundled model lists become stale between releases.

Changing every provider mechanically to the existing protocol strategy is not sufficient. That strategy specifically calls the protocol-standard model endpoint, while some providers expose a provider-native control-plane API, require a different path or response shape, or do not allow model discovery with the inference credential.

Desired outcome

Make model discovery remote-first for every ready remote provider that exposes a callable model-list API.

  • Audit every existing fallback-only provider and classify it as:
    • protocol-standard discovery;
    • provider-native discovery;
    • verified fallback-only because the available credential cannot query a model list.
  • Use the saved connection credential to fetch the provider's current model list when supported.
  • Keep bundled fallback models only for first use, offline operation, and recovery.
  • Preserve the last successfully fetched list when discovery fails.
  • Reject empty or malformed discovery responses instead of replacing a usable cached list.
  • Deduplicate and validate discovered model IDs before persistence.
  • Expose model refresh whenever a remote discovery strategy exists.
  • Refresh after credential save and allow an explicit user refresh.
  • Require a concrete limitation reason for any ready provider that remains fallback-only.
  • Add a registry contract preventing new unexplained fallback-only remote providers.
  • Cover protocol and native discovery behavior with deterministic local fixtures; CI must not require real provider credentials.

The audit must include all current fallback-only providers across Tencent, Volcengine, Xiaomi, StepFun, Alibaba, and Cloudflare.

This issue does not add a new model provider.

Alternatives or workarounds

  • Manually updating bundled model arrays does not prevent the next catalog change from becoming stale.
  • Fetching models.dev during release does not reflect account-specific availability and does not cover providers missing from models.dev.
  • Blindly replacing every fallback declaration with protocol would send requests to endpoints that may not implement the standard /models contract.

Activity

  1. added
    enhancement
    on Jul 28, 2026
  2. Astro-Han commented on Jul 28, 2026

    @Astro-Han
    ContributorAuthor

    I’m taking this. I’ll first audit every current fallback-only provider, then extend the shared discovery contract so protocol-standard discovery, provider-native discovery, and explicitly documented fallback-only cases share one last-known-good and bootstrap-fallback path. This work will remain provider-agnostic and will not add Ark Agent Plan.

  3. self-assigned this
    on Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions