Skip to content

Frontend should consume GET /api/providers instead of maintaining a manual provider table #1082

Description

@lfnovo

Context

PR #1075 introduced a single backend provider registry (open_notebook/ai/provider_registry.py) and a GET /api/providers endpoint exposing name, display name, modalities, docs URL and env-configured status. The frontend still hardcodes its own copy in frontend/src/lib/providers.tsx (ALL_PROVIDERS, PROVIDER_MODALITIES, PROVIDER_DOCS), kept in sync only by a backend test that regex-parses the .tsx file (tests/test_credential_provider_validation.py) — which already broke once when the table moved files (see #1065).

Proposal

  • Fetch provider metadata from GET /api/providers (react-query hook, cached)
  • Keep only genuinely frontend-only presentation data locally (icons)
  • Delete the regex-based cross-check test once the manual table is gone

Outcome

Adding a provider becomes: registry entry + SupportedProvider Literal (enforced by test). Zero frontend edits.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    readyApproved and ready to be worked onreleasedShipped in a stable release

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions