From bbf8d4ccb976026584a6745ee3fee100f48203f2 Mon Sep 17 00:00:00 2001 From: oyi77 Date: Thu, 28 May 2026 18:48:05 +0700 Subject: [PATCH] feat(gitlawb): serve models from static registry without API-unavailable warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GitLawB's OpenGateway API does not expose a /models endpoint per provider-path. Previously the models route fell through to the generic fallback which returned static catalog models with the misleading 'API unavailable — using local catalog' warning. Now gitlawb and gitlawb-gmi are handled as static model providers (same pattern as reka and qwen OAuth) — models are served from the provider registry without any warning, since all registered models are functional via POST /chat/completions. --- src/app/api/providers/[id]/models/route.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/app/api/providers/[id]/models/route.ts b/src/app/api/providers/[id]/models/route.ts index 3d48b42881..16602f14ad 100755 --- a/src/app/api/providers/[id]/models/route.ts +++ b/src/app/api/providers/[id]/models/route.ts @@ -1939,6 +1939,23 @@ export async function GET( }); } + // GitLawB: OpenGateway API does not expose /models endpoint per provider-path. + // All models are registered statically in the provider registry and work via + // POST /chat/completions — return them from local catalog without a warning. + if (provider === "gitlawb" || provider === "gitlawb-gmi") { + const gitlawbModels = getModelsByProviderId(provider); + return buildResponse({ + provider, + connectionId, + models: gitlawbModels.map((m: any) => ({ + id: m.id, + name: m.name || m.id, + owned_by: provider, + })), + source: "local_catalog", + }); + } + const localCatalog = mergeLocalCatalogModels(registryCatalogModels, specialtyCatalogModels); if (!config && localCatalog.length > 0) { return buildResponse({