fix(api): accept the current compatible-provider connection id scheme in the models test route (#8326) (#8359)

This commit is contained in:
Diego Rodrigues de Sa e Souza
2026-07-24 11:44:46 -03:00
committed by GitHub
parent 493708f575
commit fa46d93941
7 changed files with 207 additions and 14 deletions

View File

@@ -3,6 +3,7 @@ import { getServiceModels } from "@/lib/db/serviceModels";
import { isServiceBackendPluginId } from "@/lib/services/serviceBackends";
import { getRegistryEntry } from "@omniroute/open-sse/config/providerRegistry.ts";
import { getProviderById, getProviderByAlias } from "@/shared/constants/providers";
import { isCompatibleProviderConnectionId } from "@/shared/utils/compatibleProviderId";
/**
* Handle CORS preflight
@@ -51,9 +52,7 @@ export async function GET(request: Request, { params }: { params: Promise<{ prov
providerAlias = catalogEntry.alias || providerId;
} else {
// Allow fetching models by connection ID for compatible providers
const isCompatibleConnectionId = /^(openai|anthropic)-compatible-chat-[a-f0-9-]+$/.test(
rawProvider
);
const isCompatibleConnectionId = isCompatibleProviderConnectionId(rawProvider);
if (!isCompatibleConnectionId) {
return Response.json(
{