mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-09-25 01:27:16 +00:00
* 🛟 fix: Allow empty modelSpecs.list to unstick admin-panel saves The unconditional `.min(1)` on `specsConfigSchema.list` rejected an empty list even when `enforce: false`, leaving admin panels (which save fields path-granularly) with no atomic way to clear the list once it had been populated. Once an admin reached `list: [entry]` and deleted the only entry, every subsequent save failed schema validation and the section became stuck. Relax the schema to `.default([])`. The `.min(1)` was added in #5218 as part of bundled cleanup, not as a deliberate rule. Every consumer of `modelSpecs.list` already handles the empty/undefined case (`?.list`, `?? []`, length-checked), and `processModelSpecs` short-circuits to `undefined` when the list is empty so the runtime treats it as "no specs configured." No call site is load-bearing on length >= 1. Tighten the `buildEndpointOption.js` enforce guard from `?.list && ?.enforce` to `?.list?.length && ?.enforce`. Empty arrays are truthy in JS, so the existing guard would have entered the enforce branch on `list: []` and returned "No model spec selected" or "Invalid model spec" had `processModelSpecs` ever been bypassed. Add a runtime warn in `processModelSpecs` when `enforce: true` is configured alongside an empty list, so operators see the resulting "enforcement disabled" state in logs rather than silently getting a permissive runtime. Add coverage for the empty-list parse path in `config-schemas.spec.ts` and for the empty-list-with-enforce branch in `buildEndpointOption.spec.js`. * chore: update import order in config-schemas.spec.ts |
||
|---|---|---|
| .. | ||
| react-query | ||
| types | ||
| accessPermissions.ts | ||
| actions.ts | ||
| api-endpoints.ts | ||
| artifacts.ts | ||
| azure.ts | ||
| balance.spec.ts | ||
| balance.ts | ||
| bedrock.ts | ||
| cloudfront-config.spec.ts | ||
| codeEnvRef.spec.ts | ||
| codeEnvRef.ts | ||
| config.spec.ts | ||
| config.ts | ||
| createPayload.ts | ||
| data-service.ts | ||
| feedback.ts | ||
| file-config.spec.ts | ||
| file-config.ts | ||
| generate.ts | ||
| headers-helpers.ts | ||
| index.ts | ||
| keys.ts | ||
| mcp.ts | ||
| messages.ts | ||
| models.ts | ||
| parameterSettings.ts | ||
| parsers.ts | ||
| permissions.ts | ||
| request.ts | ||
| roles.spec.ts | ||
| roles.ts | ||
| schemas.spec.ts | ||
| schemas.ts | ||
| types.ts | ||
| utils.ts | ||