fix: allow grok2 providers to use openai-compat gateway route
Some checks failed
Build & Push Docker Image / build-and-push (push) Has been cancelled

This commit is contained in:
shiyue
2026-03-11 15:34:40 +00:00
parent 287d0020bb
commit f0b36ac2e1

View File

@@ -171,7 +171,7 @@ function parseCustomProviders(rawProviders: string | null | undefined): CustomPr
throw new Error(`PROVIDER_GATEWAY_ROUTE_INVALID: providers[${index}].gatewayRoute`) throw new Error(`PROVIDER_GATEWAY_ROUTE_INVALID: providers[${index}].gatewayRoute`)
} else if (providerKey === 'openai-compatible' && gatewayRouteRaw === 'official') { } else if (providerKey === 'openai-compatible' && gatewayRouteRaw === 'official') {
throw new Error(`PROVIDER_GATEWAY_ROUTE_INVALID: providers[${index}].gatewayRoute`) throw new Error(`PROVIDER_GATEWAY_ROUTE_INVALID: providers[${index}].gatewayRoute`)
} else if (providerKey !== 'openai-compatible' && gatewayRouteRaw === 'openai-compat') { } else if (providerKey !== 'openai-compatible' && providerKey !== 'grok2' && gatewayRouteRaw === 'openai-compat') {
throw new Error(`PROVIDER_GATEWAY_ROUTE_INVALID: providers[${index}].gatewayRoute`) throw new Error(`PROVIDER_GATEWAY_ROUTE_INVALID: providers[${index}].gatewayRoute`)
} else { } else {
gatewayRoute = gatewayRouteRaw gatewayRoute = gatewayRouteRaw