-
[E2E] [tests] feat: add OpenRouter API key fallback via custom provider in playground E2E tests (#7155)
发布于
2026-06-19 09:06:42 +00:00 Some restricted environments block direct access to OpenAI, Anthropic, and
Gemini (as well as the built-in OpenRouter provider option). Add an
OPENROUTER_API_KEY fallback that uses the Custom Provider option in the
AI Providers Configuration UI to provision an OpenAI-compatible endpoint
pointed at https://openrouter.ai/api/v1.Changes:
- configuration.page.ts: add ensureCustomProviderConfigured() + hasCustomProvider()
methods for the Custom Provider UI dialog (Provider name, URL, API key, Models list) - playground-models.yaml: add openrouter-custom provider entry with provider_type: custom
- playground-smoke.spec.ts: extend ensureModelAvailable() with OPENROUTER_API_KEY as
third fallback (Anthropic > OpenAI > OpenRouter-via-custom-provider) - playground-providers.spec.ts: add CustomProviderEntry discriminant on provider_type
and branch to ensureCustomProviderConfigured for custom providers
Verified green locally — backend confirms custom-llm row provisioned and GPT-4o-mini
responds via OpenRouter.下载附件
- configuration.page.ts: add ensureCustomProviderConfigured() + hasCustomProvider()