feat(gitlawb): serve models from static registry without API-unavailable warning

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.
This commit is contained in:
oyi77
2026-05-28 18:48:05 +07:00
parent ecb0d1dbac
commit bbf8d4ccb9

View File

@@ -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({