feat: keyless flag on the provider catalog — GUI contract tests exempt anonymous providers

opencode-free broke two provider-surface contract tests: 'api_key
providers must expose a credential env var' and 'GUI ⊇ hermes model
universe'. Both premises assume a credential exists. Add a keyless flag
to HermesOverlay + ProviderDescriptor (same derived-exemption pattern as
virtual providers) so any future anonymous provider is covered without
hardcoded slugs. Nothing to configure = no Providers-tab card, by design;
the model picker remains the selection surface.
This commit is contained in:
Teknium
2026-08-21 00:08:23 -07:00
parent a63da06340
commit 930be347f1
4 changed files with 17 additions and 5 deletions
+5 -4
View File
@@ -57,13 +57,14 @@ def test_api_key_providers_expose_a_credential_env_var():
surface at least one env var to write the key into (otherwise the GUI can't
configure it).
Exemptions: ``aws_sdk`` (bedrock — uses AWS_REGION/AWS_PROFILE) and the
``custom`` bring-your-own-endpoint pseudo-provider, which is configured
inline via the local-endpoint flow rather than a fixed env var.
Exemptions: ``aws_sdk`` (bedrock — uses AWS_REGION/AWS_PROFILE), the
``custom`` bring-your-own-endpoint pseudo-provider (configured inline via
the local-endpoint flow), and keyless providers (``d.keyless`` — e.g.
opencode-free, served anonymously: there is no credential to write).
"""
exempt = {"custom"}
for d in provider_catalog():
if d.auth_type == "api_key" and d.slug not in exempt:
if d.auth_type == "api_key" and d.slug not in exempt and not d.keyless:
assert d.api_key_env_vars, f"{d.slug} is api_key but exposes no env var"