🐛 fix: Safeguard against undefined length for addedEndpoints in modelSpecs processing (#6654)

This commit is contained in:
Sean McGrath 2025-04-02 01:06:25 +13:00 committed by GitHub
parent 9b6fa89622
commit 677423d82c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -21,7 +21,7 @@ function processModelSpecs(endpoints, _modelSpecs, interfaceConfig) {
const customEndpoints = endpoints?.[EModelEndpoint.custom] ?? [];
if (interfaceConfig.modelSelect !== true && _modelSpecs.addedEndpoints.length > 0) {
if (interfaceConfig.modelSelect !== true && (_modelSpecs.addedEndpoints?.length ?? 0) > 0) {
logger.warn(
`To utilize \`addedEndpoints\`, which allows provider/model selections alongside model specs, set \`modelSelect: true\` in the interface configuration.