Skip to content

provider metadata split across two files can silently drift (KeyError escape) #19

Description

@ernestprovo23

Provider metadata is split across two files that can silently drift: env-var names in registry.PROVIDER_ENV_VARS, URLs in openai_compat.OPENAI_COMPAT_URLS. Adding an OpenAI-compatible provider requires editing both. A mismatch (URL present, env var missing) surfaces as a runtime KeyError in _openai_compat_adapter (adapters/__init__.py:54-58) that is not caught by the ProviderError handler and escapes to the broad except Exception (providers.py:118). This is also a #5 (first-class providers) friction point.

Acceptance

  • Add a module-level consistency check/test asserting every key in OPENAI_COMPAT_URLS has a matching PROVIDER_ENV_VARS entry — or consolidate into one table.
  • Document the per-provider edit step.

Source: pre-dev planning audit 2026-06-08 (finding D-7).

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtRefactor, debt paydown, internal quality

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions